Skip to content

chore: add python 3.14 test matrix and update dependencies (#334) #125

chore: add python 3.14 test matrix and update dependencies (#334)

chore: add python 3.14 test matrix and update dependencies (#334) #125

Workflow file for this run

name: Semantic Release
on:
push:
branches:
- main
# default: least privileged permissions across all jobs
permissions:
contents: read
jobs:
# Tests run automatically on push to main via tests.yml
# Branch protection rules ensure tests pass before this workflow runs
release:
runs-on: ubuntu-latest
outputs:
released: ${{ steps.release.outputs.released }}
tag: ${{ steps.release.outputs.tag }}
concurrency:
group: ${{ github.workflow }}-release-${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Generate bot app token
id: generate_token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
with:
app-id: ${{ secrets.MY_RELEASER_ID }}
private-key: ${{ secrets.MY_RELEASER_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ steps.generate_token.outputs.token }}
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: "3.10"
cache: 'pip'
- name: Cache Poetry virtualenv
uses: actions/cache@v5
with:
path: |
~/.cache/pypoetry/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry==2.0.1
poetry install
- name: Action | Semantic Version Release
id: release
uses: python-semantic-release/python-semantic-release@350c48fcb3ffcdfd2e0a235206bc2ecea6b69df0
with:
github_token: ${{ steps.generate_token.outputs.token }}
git_committer_name: "semantic-release"
git_committer_email: "semantic-release@users.noreply.github.com"
build: false
- name: Debug | Check if CHANGELOG.md exists and show git status
if: steps.release.outputs.released == 'true'
run: |
echo "=== Checking CHANGELOG.md ==="
if [ -f CHANGELOG.md ]; then
echo "✅ CHANGELOG.md exists"
echo "File size: $(wc -c < CHANGELOG.md) bytes"
echo "Last 20 lines:"
tail -20 CHANGELOG.md
else
echo "❌ CHANGELOG.md does NOT exist"
fi
echo ""
echo "=== Git Status ==="
git status
echo ""
echo "=== Git Log (last commit) ==="
git log -1 --stat
- name: Build package
if: steps.release.outputs.released == 'true'
run: poetry build
- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@310a9983a0ae878b29f3aac778d7c77c1db27378
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ steps.generate_token.outputs.token }}
tag: ${{ steps.release.outputs.tag }}
- name: Upload | Distribution Artifacts
uses: actions/upload-artifact@v6
if: steps.release.outputs.released == 'true'
with:
name: distribution-artifacts
path: dist
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
needs: release
if: ${{ needs.release.outputs.released == 'true' }}
environment:
name: pypi
url: https://pypi.org/p/goodmap
permissions:
contents: read
id-token: write
steps:
- name: Setup | Download Build Artifacts
uses: actions/download-artifact@v7
with:
name: distribution-artifacts
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e
with:
packages-dir: dist