export actions #31
Workflow file for this run
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 | |
on: | |
pull_request: | |
branches-ignore: | |
- 'master' | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' | |
jobs: | |
release-to-pypi: | |
runs-on: ubuntu-22.04 | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up PDM | |
uses: pdm-project/setup-pdm@v4 | |
with: | |
cache: true | |
- name: Build | |
run: pdm build | |
env: | |
PDM_BUILD_SCM_VERSION: ${{github.ref_name}} | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: Upload packages as artifacts | |
uses: actions/upload-artifact@v2-preview | |
with: | |
name: chaostoolkit-aws-packages | |
path: dist/chaostoolkit_aws-* | |
create-gh-release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Create Release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
upload-gh-release-assets: | |
runs-on: ubuntu-22.04 | |
needs: | |
- create-gh-release | |
- release-to-pypi | |
steps: | |
- name: Download pypi artifacts | |
uses: actions/download-artifact@v2-preview | |
with: | |
name: chaostoolkit-aws-packages | |
path: dist | |
- name: Upload wheel & source dist to GH release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifact: "dist/*.whl,dist/*.tar.gz" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true |