Skip to content

šŸ“š DOCS: Add new tutorial modules #2104

šŸ“š DOCS: Add new tutorial modules

šŸ“š DOCS: Add new tutorial modules #2104

Workflow file for this run

name: release
# Automate publishing 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@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- 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@v6
- 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
steps:
- uses: actions/checkout@v6
- name: Install aiida-core
uses: ./.github/actions/install-aiida-core
- name: Run sub-set of test suite
run: pytest -s -m requires_broker --broker-backend zmq --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
environment: release
permissions:
id-token: write
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install flit
run: pip install flit~=3.4
- name: Build
run: flit build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
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
environment: release
permissions:
id-token: write
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install flit
run: pip install flit~=3.4
- name: Build
run: flit build
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
⚔