Skip to content

🚀 Publish Release #3

🚀 Publish Release

🚀 Publish Release #3

Workflow file for this run

name: 🚀 Publish Release
on:
release:
types: [published]
permissions:
contents: read
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: ⬇️ Checkout repository
- uses: actions/setup-python@v5.1.1
name: 📦 Setup Python
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
- name: 🔍 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: 🏗 Build release
run: python -m build
- uses: actions/upload-artifact@v4.3.6
name: 📤 Upload artifact
with:
name: release
path: dist/
pypi-publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- release-build
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/project/geothai
steps:
- uses: actions/download-artifact@v4.1.8
name: 📥 Download artifact
with:
name: release-dists
path: dist/
- uses: pypa/gh-action-pypi-publish@v1.9.0
name: 🚀 Publish package
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
github-release:
runs-on: ubuntu-latest
needs:
- pypi-publish
permissions:
contents: write
id-token: write
steps:
- uses: actions/download-artifact@v4.1.8
name: 📥 Download artifact
with:
name: release-dists
path: dist/
- uses: sigstore/gh-action-sigstore-python@v3.0.0
name: 🔑 Sign artifact
with:
inputs: dist/*
- name: 🚀 Create Release
run:
gh release create ${{ github.ref_name }} --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: 🚀 Upload Release Asset
run:
gh release upload ${{ github.ref_name }} dist/* --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ github.token }}