diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0c75bba..9174c47 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -7,16 +7,34 @@ permissions: on: ["workflow_dispatch", "push"] jobs: deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - steps: - - name: Upload to pages branch - uses: fastai/workflows/quarto-ghp@master - with: - version: '3.11' - - name: build - run: build.sh - - name: release upload - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - files: dist/* \ No newline at end of file + steps: + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Render Quarto Project + uses: quarto-dev/quarto-actions/render@v2 + with: + path: nbs + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "_docs" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: build + run: build.sh + - name: release upload + uses: softprops/action-gh-release@v1 + with: + files: "dist/*" \ No newline at end of file diff --git a/install.sh b/install.sh index 604b03a..351d5cf 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/bash # This is meant to be run to setup and prep for committing a release -# use nbdev_bump_version to increment the version itself then rerun this to update README.md etc +# use nbdev_bump_version to increment the version itself then rerun this to update README.md _docs etc pip install nbdev nbdev_install npx npm-check-updates -u # convenient way to freshen package.json on each release @@ -8,7 +8,7 @@ npm install npm run build nbdev_clean nbdev_export -nbdev_readme -nbdev_install_hooks version=$(awk -F' = ' '/^version/{print $2}' settings.ini) -sed -i '' "s/{{ version }}/$version/g" README.md \ No newline at end of file +echo "version: $version" > nbs/_variables.yml +nbdev_readme +quarto render nbs \ No newline at end of file diff --git a/nbdev_squ/api.py b/nbdev_squ/api.py index 3c98192..37deb37 100644 --- a/nbdev_squ/api.py +++ b/nbdev_squ/api.py @@ -44,7 +44,7 @@ def abuseipdb(self): """ Returns an abuseipdb client """ - return AbuseIPDB(API_KEY=self.config.abuseipdb_api_key) + return AbuseIPDB(api_key=self.config.abuseipdb_api_key) @cached_property def jira(self): diff --git a/nbs/01_api.ipynb b/nbs/01_api.ipynb index c3435f9..e043e57 100644 --- a/nbs/01_api.ipynb +++ b/nbs/01_api.ipynb @@ -105,7 +105,7 @@ " \"\"\"\n", " Returns an abuseipdb client\n", " \"\"\"\n", - " return AbuseIPDB(API_KEY=self.config.abuseipdb_api_key)\n", + " return AbuseIPDB(api_key=self.config.abuseipdb_api_key)\n", "\n", " @cached_property\n", " def jira(self):\n", diff --git a/nbs/_variables.yml b/nbs/_variables.yml new file mode 100644 index 0000000..d0e6b09 --- /dev/null +++ b/nbs/_variables.yml @@ -0,0 +1 @@ +version: 1.3.2 diff --git a/nbs/index.ipynb b/nbs/index.ipynb index c7a025e..0318abd 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -28,13 +28,13 @@ "Below is how to install in a plain python 3.11+ environment\n", "\n", "```sh\n", - "https://github.com/wagov/nbdev-squ/releases/download/v{{ version }}/nbdev_squ-{{ version }}-py3-none-any.whl\n", + "https://github.com/wagov/nbdev-squ/releases/download/v{{< var version >}}/nbdev_squ-{{< var version >}}-py3-none-any.whl\n", "```\n", "\n", "The installation can also be run in a notebook (we tend to use [JupyterLab Desktop](https://github.com/jupyterlab/jupyterlab-desktop) for local dev). The `SQU_CONFIG` env var indicates to nbdev_squ it should load the json secret *squconfig-`my_keyvault_tenantid`* from the `my_kevault_name` keyvault.\n", "\n", "```python\n", - "%pip install https://github.com/wagov/nbdev-squ/releases/download/v{{ version }}/nbdev_squ-{{ version }}-py3-none-any.whl\n", + "%pip install https://github.com/wagov/nbdev-squ/releases/download/v{{< var version >}}/nbdev_squ-{{< var version >}}-py3-none-any.whl\n", "import os; os.environ[\"SQU_CONFIG\"] = \"{{ my_keyvault_name }}/{{ my_keyvault_tenantid }}\" \n", "\n", "from nbdev_squ import api\n", @@ -201,9 +201,6 @@ "display_name": "python3", "language": "python", "name": "python3" - }, - "language_info": { - "name": "" } }, "nbformat": 4, diff --git a/nbs/sidebar.yml b/nbs/sidebar.yml index 2a6a61f..59764f5 100644 --- a/nbs/sidebar.yml +++ b/nbs/sidebar.yml @@ -3,4 +3,4 @@ website: contents: - index.ipynb - 00_core.ipynb - - 01_api.ipynb \ No newline at end of file + - 01_api.ipynb