Merge pull request #207 from jtpio/releaser

Adopt the Jupyter Releaser
This commit is contained in:
Jeremy Tuloup 2021-09-07 15:48:07 +02:00 committed by GitHub
commit 9029689ed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 235 deletions

View File

@ -18,19 +18,7 @@ defaults:
shell: bash -l {0}
jobs:
integrity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build checksum file
run: |
sed -n 20,146p .github/workflows/build.yml > build
sed -n 20,146p .github/workflows/release.yml > release
diff build release
test:
needs: [integrity]
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -65,7 +53,6 @@ jobs:
jlpm run test
build:
needs: [integrity]
runs-on: ubuntu-latest
steps:
- name: Checkout

View File

@ -17,19 +17,23 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: "x64"
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v1
with:
@ -37,6 +41,7 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache checked links
uses: actions/cache@v2
with:
@ -44,15 +49,31 @@ jobs:
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
restore-keys: |
${{ runner.os }}-linkcheck-
- name: Upgrade packaging dependencies
run: |
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.7.9 --user
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
- name: Install Dependencies
run: |
pip install .
- name: Configure Version Spec
id: version-spec
if: ${{ matrix.group == 'check_release' }}
run: |
set -eux
version=$(python setup.py --version)
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version_spec=patch
else
version_spec=build
fi
echo "::set-output name=spec::${version_spec}"
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
env:
RH_VERSION_SPEC: patch
RH_VERSION_SPEC: ${{ steps.version-spec.outputs.spec }}
with:
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,219 +0,0 @@
name: Release
on:
push:
tags:
- '*'
permissions:
contents:
write
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
defaults:
run:
shell: bash -l {0}
jobs:
integrity:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build checksum file
run: |
sed -n 20,146p .github/workflows/build.yml > build
sed -n 20,146p .github/workflows/release.yml > release
diff build release
test:
needs: [integrity]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install jupyter_packaging~=0.10
- name: Install the package
run: |
python -m pip install .
jupyter labextension list 2>&1 | grep -ie "@retrolab/lab-extension.*enabled.*ok" -
jupyter server extension list 2>&1 | grep -ie "retrolab.*enabled" -
python -m jupyterlab.browser_check
- name: Lint
run: |
jlpm
jlpm run eslint:check
jlpm run prettier:check
- name: Test
run: |
jlpm run build:test
jlpm run test
build:
needs: [integrity]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install setuptools jupyter_packaging~=0.10 "jupyterlab>=3,<4" build
- name: Build pypi distributions
run: |
python -m build
- name: Build npm distributions
run: |
mkdir pkgs
jlpm lerna exec -- npm pack
cp packages/*/*.tgz pkgs
- name: Build checksum file
run: |
cd dist
sha256sum * | tee SHA256SUMS
cd ../pkgs
sha256sum * | tee SHA256SUMS
- name: Upload distributions
uses: actions/upload-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Upload distributions
uses: actions/upload-artifact@v2
with:
name: pkgs ${{ github.run_number }}
path: ./pkgs
install:
runs-on: ${{ matrix.os }}-latest
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python: ['3.6', '3.9']
include:
- python: '3.6'
dist: 'retrolab*.tar.gz'
- python: '3.9'
dist: 'retrolab*.whl'
- os: windows
py_cmd: python
- os: macos
py_cmd: python3
- os: ubuntu
py_cmd: python
steps:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- uses: actions/download-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
run: |
${{ matrix.py_cmd }} -m pip install pip wheel
- name: Install the package
run: |
cd dist
${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
- name: Validate environment
run: |
${{ matrix.py_cmd }} -m pip freeze
${{ matrix.py_cmd }} -m pip check
- name: Validate the install
run: |
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "@retrolab/lab-extension.*enabled.*ok" -
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "retrolab.*enabled" -
jupyter retro --version
jupyter retro --help
release:
if: startsWith(github.ref, 'refs/tags/')
needs: [install]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Cleanup dist
run: |
rm dist/SHA256SUMS
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: |
python -m pip install -U jupyterlab~=3.0 jupyter_packaging~=0.10 pip
jlpm
jlpm run build
- uses: actions/download-artifact@v2
with:
name: pkgs ${{ github.run_number }}
path: ./pkgs
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# do not publish the metapackage
rm pkgs/retrolab-metapackage*
jlpm config set registry https://registry.npmjs.org
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
cp ~/.npmrc .npmrc
jlpm release:npm --dist ./pkgs
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
# TODO: set to false?
draft: true
prerelease: ${{ contains(github.ref, 'a') || contains(github.ref, 'b') || contains(github.ref, 'rc') }}

View File

@ -1,6 +1,6 @@
{
"name": "@retrolab/root",
"version": "0.3.0-rc.0",
"version": "0.1.0",
"private": true,
"homepage": "https://github.com/jupyterlab/retrolab",
"bugs": {