From 596aad034b8194c0a2b7166a9205876aff6bf9ad Mon Sep 17 00:00:00 2001 From: Duc Trung Le Date: Tue, 5 Dec 2023 16:41:17 +0100 Subject: [PATCH] Add jupyter-releaser workflow (#157) * Add releaser workflow * Add repo to package.json * ignore W002 --- .github/workflows/check-release.yml | 27 +++------- .github/workflows/prep-release.yml | 45 ++++++++++++++++ .github/workflows/publish-release.yml | 57 +++++++++++++++++++++ packages/application-extension/package.json | 4 ++ packages/application/package.json | 4 ++ packages/apputils/package.json | 4 ++ packages/channels-extension/package.json | 4 ++ packages/home-extension/package.json | 4 ++ packages/jobs-extension/package.json | 4 ++ packages/login-extension/package.json | 4 ++ packages/menu-extension/package.json | 4 ++ packages/menu/package.json | 4 ++ packages/search-extension/package.json | 4 ++ packages/table/package.json | 4 ++ packages/user-extension/package.json | 4 ++ pyproject.toml | 7 ++- quetz_frontend/app/package.json | 4 ++ quetz_frontend/backend.py | 2 +- 18 files changed, 166 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/prep-release.yml create mode 100644 .github/workflows/publish-release.yml diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 1301e93..0fa3e47 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -2,20 +2,13 @@ name: Check Release on: push: - branches: [main] + branches: ["main"] pull_request: - branches: [main] - release: - types: [published] + branches: ["*"] jobs: - check_release: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - group: [check_release, link_check] steps: - name: Checkout uses: actions/checkout@v3 @@ -27,22 +20,14 @@ jobs: node_version: 16 - name: Check Release - if: ${{ matrix.group == 'check_release' }} - uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 + uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 with: token: ${{ secrets.GITHUB_TOKEN }} version_spec: next - - name: Run Link Check - if: ${{ matrix.group == 'link_check' }} - uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Assets - if: ${{ matrix.group == 'check_release' }} + - name: Upload Distributions uses: actions/upload-artifact@v3 with: - name: jupyterlab-releaser-dist-${{ github.run_number }} + name: jupyter-releaser-dist-${{ github.run_number }} path: | - .jupyter_releaser_checkout/dist/*.* \ No newline at end of file + .jupyter_releaser_checkout/dist \ No newline at end of file diff --git a/.github/workflows/prep-release.yml b/.github/workflows/prep-release.yml new file mode 100644 index 0000000..0f76ad0 --- /dev/null +++ b/.github/workflows/prep-release.yml @@ -0,0 +1,45 @@ +name: 'Step 1: Prep Release' +on: + workflow_dispatch: + inputs: + version_spec: + description: 'New Version Specifier' + default: 'next' + required: false + branch: + description: 'The branch to target' + required: false + post_version_spec: + description: 'Post Version Specifier' + required: false + since: + description: 'Use PRs with activity since this date or git reference' + required: false + since_last_stable: + description: 'Use PRs with activity since the last stable git tag' + required: false + type: boolean +jobs: + prep_release: + runs-on: ubuntu-latest + steps: + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + with: + python_version: 3.9 + node_version: 16 + + - name: Prep Release + id: prep-release + uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 + with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + version_spec: ${{ github.event.inputs.version_spec }} + post_version_spec: ${{ github.event.inputs.post_version_spec }} + target: ${{ github.event.inputs.target }} + branch: ${{ github.event.inputs.branch }} + since: ${{ github.event.inputs.since }} + since_last_stable: ${{ github.event.inputs.since_last_stable }} + + - name: '** Next Step **' + run: | + echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}" diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..ea529d2 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,57 @@ +name: 'Step 2: Publish Release' +on: + workflow_dispatch: + inputs: + branch: + description: 'The target branch' + required: false + release_url: + description: 'The URL of the draft GitHub release' + required: false + steps_to_skip: + description: 'Comma separated list of steps to skip' + required: false + +jobs: + publish_release: + runs-on: ubuntu-latest + steps: + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + with: + python_version: 3.9 + node_version: 16 + + - name: Populate Release + id: populate-release + uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 + with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + target: ${{ github.event.inputs.target }} + branch: ${{ github.event.inputs.branch }} + release_url: ${{ github.event.inputs.release_url }} + steps_to_skip: ${{ github.event.inputs.steps_to_skip }} + + - name: Finalize Release + id: finalize-release + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }} + TWINE_USERNAME: __token__ + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2 + with: + token: ${{ secrets.ADMIN_GITHUB_TOKEN }} + target: ${{ github.event.inputs.target }} + release_url: ${{ steps.populate-release.outputs.release_url }} + + - name: '** Next Step **' + if: ${{ success() }} + run: | + echo "Verify the final release" + echo ${{ steps.finalize-release.outputs.release_url }} + + - name: '** Failure Message **' + if: ${{ failure() }} + run: | + echo "Failed to Publish the Draft Release Url:" + echo ${{ steps.populate-release.outputs.release_url }} diff --git a/packages/application-extension/package.json b/packages/application-extension/package.json index 4655219..7711f19 100644 --- a/packages/application-extension/package.json +++ b/packages/application-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/application/package.json b/packages/application/package.json index 5ac71e8..76f166a 100644 --- a/packages/application/package.json +++ b/packages/application/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/apputils/package.json b/packages/apputils/package.json index f1d1001..7b0131d 100644 --- a/packages/apputils/package.json +++ b/packages/apputils/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/channels-extension/package.json b/packages/channels-extension/package.json index 69ba410..1d94ef7 100644 --- a/packages/channels-extension/package.json +++ b/packages/channels-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/home-extension/package.json b/packages/home-extension/package.json index 32da011..9dc5495 100644 --- a/packages/home-extension/package.json +++ b/packages/home-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/jobs-extension/package.json b/packages/jobs-extension/package.json index 3fcbad0..9d97552 100644 --- a/packages/jobs-extension/package.json +++ b/packages/jobs-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/login-extension/package.json b/packages/login-extension/package.json index 9c82c38..bc471f5 100644 --- a/packages/login-extension/package.json +++ b/packages/login-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/menu-extension/package.json b/packages/menu-extension/package.json index 46c44d3..e6d1e62 100644 --- a/packages/menu-extension/package.json +++ b/packages/menu-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/menu/package.json b/packages/menu/package.json index 76efacf..e660e71 100644 --- a/packages/menu/package.json +++ b/packages/menu/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/search-extension/package.json b/packages/search-extension/package.json index 9345151..0352bdd 100644 --- a/packages/search-extension/package.json +++ b/packages/search-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/table/package.json b/packages/table/package.json index b013aea..ce84caa 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/packages/user-extension/package.json b/packages/user-extension/package.json index 9258034..76a8bb2 100644 --- a/packages/user-extension/package.json +++ b/packages/user-extension/package.json @@ -11,6 +11,10 @@ "directories": { "lib": "lib/" }, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "files": [ "lib/*.d.ts", "lib/*.js.map", diff --git a/pyproject.toml b/pyproject.toml index 00f652f..091dc0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,8 +20,11 @@ npm = ["yarn"] ignore = ["builder/**", "examples/**", "packages/**", "quetz_frontend/app/static/**", "quetz_frontend/app/themes/**", "quetz_frontend/app/build/**", "quetz_frontend/app/style.js", "scripts/**", "environment.yml", "yarn.lock", ".*"] [tool.jupyter-releaser.hooks] -before-bump-version = ["yarn"] -before-build-npm = ["yarn"] +before-bump-version = ["python -m pip install build", "yarn"] +before-build-npm = ["yarn", "yarn build:prod"] [tool.jupyter-releaser.options] version-cmd = "python scripts/bump-version.py --force" + +[tool.check-wheel-contents] +ignore = ["W002"] \ No newline at end of file diff --git a/quetz_frontend/app/package.json b/quetz_frontend/app/package.json index 2970a0e..983a3ee 100644 --- a/quetz_frontend/app/package.json +++ b/quetz_frontend/app/package.json @@ -2,6 +2,10 @@ "name": "@quetz-frontend/main-app", "version": "0.4.0", "private": true, + "repository": { + "type": "git", + "url": "https://github.com/mamba-org/quetz-frontend.git" + }, "scripts": { "build": "yarn run clean && webpack", "build:dev": "yarn run build", diff --git a/quetz_frontend/backend.py b/quetz_frontend/backend.py index 0cc3286..1f8b26f 100644 --- a/quetz_frontend/backend.py +++ b/quetz_frontend/backend.py @@ -236,7 +236,7 @@ def register(app): azuread_login_available = auth_registry.is_registered("azuread") config_data = { - "appName": "Quetz – the fast conda package server!", + "appName": "Quetz - the fast conda package server!", "baseUrl": "/", "wsUrl": "", "appUrl": f"/{ROUTE_PREFIX}",