Skip to content

Commit

Permalink
Add jupyter-releaser workflow (#157)
Browse files Browse the repository at this point in the history
* Add releaser workflow

* Add repo to package.json

* ignore W002
  • Loading branch information
trungleduc authored Dec 5, 2023
1 parent b9fe896 commit 596aad0
Show file tree
Hide file tree
Showing 18 changed files with 166 additions and 24 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/*.*
.jupyter_releaser_checkout/dist
45 changes: 45 additions & 0 deletions .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
57 changes: 57 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 4 additions & 0 deletions packages/application-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/apputils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/channels-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/home-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/jobs-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/login-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/menu-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/search-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions packages/user-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 4 additions & 0 deletions quetz_frontend/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion quetz_frontend/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down

0 comments on commit 596aad0

Please sign in to comment.