Semantic Release #7
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: 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 |