Skip to content

Semantic Release

Semantic Release #7

Workflow file for this run

name: Semantic Release
on:
push:
branches:
- master # Changed from tags to branch as per the example
workflow_dispatch: # Kept for manual triggering
jobs:
release:
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
steps:
- name: Check out the code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install Dependencies
run: |
pip install maturin
pip install python-semantic-release toml
- name: Python Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Publish with Maturin
if: steps.release.outputs.released == 'true'
env:
MATURIN_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
maturin build --release
maturin publish --username __token__ --password $MATURIN_PASSWORD