Continous Release #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
run-name: "Continous Release" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * 3' # this means every Wednesday @1am UTC | |
permissions: | |
contents: read | |
jobs: | |
rc: | |
name: Check if we need a new release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: read | |
outputs: | |
rc: ${{ steps.rc.outputs.new_release_published }} | |
ver: ${{ steps.rc.outputs.new_release_version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check if new version will be produced | |
id: rc | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
dry_run: true | |
semantic_version: 19.0 | |
extra_plugins: | | |
conventional-changelog-conventionalcommits@^5.0.0 | |
@semantic-release/git@^10.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
pyversion: | |
name: Discover minimum Python version | |
needs: rc | |
if: needs.rc.outputs.rc == 'true' | |
uses: ./.github/workflows/_discover_python_ver.yml | |
code_format: | |
name: Validate code formatting | |
needs: pyversion | |
uses: ./.github/workflows/sub_format.yml | |
with: | |
python_version: ${{ needs.pyversion.outputs.pyversion }} | |
unit_tests: | |
name: Validate all Unit Tests pass | |
needs: pyversion | |
permissions: | |
contents: write | |
uses: ./.github/workflows/sub_unittest.yml | |
with: | |
python_version: ${{ needs.pyversion.outputs.pyversion }} | |
documentation_check: | |
name: Validate that the API documentation is up to date | |
needs: pyversion | |
uses: ./.github/workflows/sub_docs.yml | |
with: | |
python_version: ${{ needs.pyversion.outputs.pyversion }} | |
release: | |
name: Create a new release | |
runs-on: ubuntu-latest | |
if: needs.rc.outputs.rc == 'true' | |
needs: | |
- rc | |
- code_format | |
- unit_tests | |
- documentation_check | |
- pyversion | |
concurrency: release | |
permissions: | |
contents: write | |
issues: read | |
outputs: | |
released: ${{ steps.release.outputs.new_release_published }} | |
tag: ${{ steps.release.outputs.new_release_git_tag }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ needs.pyversion.outputs.pyversion }} | |
- name: Install Poetry | |
uses: Gr1N/setup-poetry@v8 | |
- name: Create Poetry venv | |
run: | | |
poetry env use ${{ needs.pyversion.outputs.pyversion }} | |
- name: Bump package version | |
env: | |
VERSION: ${{ needs.rc.outputs.ver }} | |
run: | | |
poetry version "${VERSION}" | |
- name: Create release and publish to GitHub | |
id: release | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
semantic_version: 19.0 | |
extra_plugins: | | |
conventional-changelog-conventionalcommits@^5.0.0 | |
@semantic-release/git@^10.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} |