Skip to content

ci: first attempt at new release action #1

ci: first attempt at new release action

ci: first attempt at new release action #1

Workflow file for this run

name: Release
on:
push:
branches:
- release
- release-test
jobs:
Test:
uses: Helmholtz-AI-Energy/perun/.github/workflows/run_tests.yaml@cx/continous-release-refactor
Version-And-Changelog:
needs: Test
concurrency: publish
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
pip install poetry
poetry install --with dev
- name: Update version and changelog
run: |
semantic-release version --skip-build --no-vcs-release
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Release-to-Pypi:
needs: Version-And-Changelog
runs-on: ubuntu-latest
environment: release
concurrency: publish
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
pip install poetry
- name: Build perun
run: |
poetry build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish to Pypi
if: ${{ github.head_ref == 'release' }}
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish
- name: Publish to Test Pypi
if: ${{ github.head_ref == 'release-test' }}
run: |
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry config pypi-token.testpypi ${{ secrets.TESTPYPI_TOKEN }}
poetry publish --repostitory testpypi
Release-to-GitHub:
needs: Release-to-Pypi
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'