Skip to content

More typing for cmdline.params module #466

More typing for cmdline.params module

More typing for cmdline.params module #466

Workflow file for this run

name: release
# Automate plubishing to PyPI and TestPyPI. When pushing a release tag vX.Y.Z,
# the workflow will publish to PyPI. When the 'test-release' label is active on
# a PR, the workflow will publish to TestPyPI on each update. In both cases it
# is checked if pre-commit and the tests pass. When a release tag is pushed it
# will in addition check if the tag and aiida-core version and tag match.
on:
# pull request event we use for test releases
pull_request:
branches-ignore: [gh-pages]
paths-ignore: [docs/**]
# tag push event we use for the official release
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
env:
FORCE_COLOR: 1
jobs:
check-release-tag:
if: github.repository == 'aiidateam/aiida-core' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Check tag
run: python .github/workflows/check_release_tag.py $GITHUB_REF
pre-commit:
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'test-release'))
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install aiida-core and pre-commit
uses: ./.github/actions/install-aiida-core
with:
python-version: '3.11'
extras: pre-commit
from-lock: 'false'
- name: Run pre-commit
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
tests:
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'test-release'))
runs-on: ubuntu-24.04
timeout-minutes: 30
services:
rabbitmq:
image: rabbitmq:3.8.14-management
ports:
- 5672:5672
- 15672:15672
steps:
- uses: actions/checkout@v4
- name: Install aiida-core
uses: ./.github/actions/install-aiida-core
- name: Run sub-set of test suite
run: pytest -s -m requires_rmq --db-backend=sqlite tests/
publish-pypi:
if: startsWith(github.ref, 'refs/tags/')
name: Publish to PyPI
needs: [check-release-tag, pre-commit, tests]
runs-on: ubuntu-24.04
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: install flit
run: |
pip install flit~=3.4
- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
publish-testpypi:
if: github.event_name == 'pull_request' && contains(fromJson(toJson(github.event.pull_request.labels)).*.name, 'test-release')
name: Publish to test PyPI
needs: [pre-commit, tests]
runs-on: ubuntu-24.04
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: install flit
run: |
pip install flit~=3.4
- name: Build and publish
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.TEST_PYPI_KEY }}
FLIT_INDEX_URL: https://test.pypi.org/legacy/