Skip to content

build

build #13

Workflow file for this run

name: Publish USCodeKit
on:
push:
tags:
- "v*.*.*"
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
environment: gh
steps:
# Checkout the repository
- name: Check out code
uses: actions/checkout@v4
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11" # or any version compatible with your package
# Install Poetry
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 -
# Configure Poetry to use the project environment
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
# Install dependencies
- name: Install dependencies
run: poetry install
# Import GPG key (from GitHub secrets in the PyPI environment)
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
# Build the package
- name: Build the USCodeKit package
run: poetry build
# Sign the package
- name: Sign the USCodeKit package
env:
GPG_TTY: $(tty)
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
gpg --batch --yes --passphrase "$GPG_PASSPHRASE" --detach-sign -a dist/*.tar.gz
gpg --batch --yes --passphrase "$GPG_PASSPHRASE" --detach-sign -a dist/*.whl
# Create GitHub Release
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
# Upload release assets to GitHub
- name: Upload release assets
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
dist/*.tar.gz
dist/*.whl
token: ${{ secrets.CUSTOM_GH_TOKEN }}