Skip to content

Release v0.7.0

Release v0.7.0 #4

Workflow file for this run

---
name: Release
on:
push:
tags:
- "v*"
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.13
- name: Build package
run: uv build
- name: Upload distribution artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
build-executables:
name: Build ${{ matrix.os }} ${{ matrix.arch }} executable
runs-on: ${{ matrix.runner }}
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
include:
# AMD64 builds
- os: linux
arch: amd64
runner: ubuntu-latest
artifact_name: phabfive
asset_name: phabfive-linux-amd64
- os: macos
arch: amd64
runner: macos-14
artifact_name: phabfive
asset_name: phabfive-macos-amd64
- os: windows
arch: amd64
runner: windows-latest
artifact_name: phabfive.exe
asset_name: phabfive-windows-amd64.exe
# ARM64 builds
- os: linux
arch: arm64
runner: ubuntu-24.04-arm
artifact_name: phabfive
asset_name: phabfive-linux-arm64
- os: macos
arch: arm64
runner: macos-latest
artifact_name: phabfive
asset_name: phabfive-macos-arm64
- os: windows
arch: arm64
runner: windows-11-arm
artifact_name: phabfive.exe
asset_name: phabfive-windows-arm64.exe
skip_signing: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Cosign
if: ${{ !matrix.skip_signing }}
uses: sigstore/cosign-installer@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install .
- name: Build executable
shell: bash
run: |
pyinstaller --onefile --name phabfive phabfive/cli.py \
--collect-data rich \
--copy-metadata rich \
--collect-data phabricator \
--hidden-import phabricator \
--hidden-import anyconfig.backend.yaml \
--exclude-module mkdocs
- name: Rename artifact
shell: bash
run: mv dist/${{ matrix.artifact_name }} dist/${{ matrix.asset_name }}
- name: Sign executable with Sigstore
if: ${{ !matrix.skip_signing }}
shell: bash
run: |
cosign sign-blob dist/${{ matrix.asset_name }} \
--bundle dist/${{ matrix.asset_name }}.sigstore.json \
--yes
- name: Upload executable and signature
if: ${{ !matrix.skip_signing }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: |
dist/${{ matrix.asset_name }}
dist/${{ matrix.asset_name }}.sigstore.json
- name: Upload executable (unsigned)
if: ${{ matrix.skip_signing }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: dist/${{ matrix.asset_name }}
publish-pypi:
name: Publish to PyPI
needs: build
if: ${{ !contains(github.ref_name, '-rc') }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/phabfive
permissions:
id-token: write
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: Create GitHub Release
needs: [build, publish-pypi, build-executables]
if: ${{ always() && needs.build.result == 'success' && needs.build-executables.result == 'success' && (needs.publish-pypi.result == 'success' || needs.publish-pypi.result == 'skipped') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Prepare release assets
run: |
mkdir -p release-assets
# Copy Python distributions
cp artifacts/python-package-distributions/* release-assets/
# Copy executables
for dir in artifacts/phabfive-*/; do
cp "$dir"* release-assets/ 2>/dev/null || true
done
ls -la release-assets/
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
release-assets/*