Skip to content

release: 0.7.0

release: 0.7.0 #308

Workflow file for this run

# Build platform wheels for `pyfun-lang` and publish to PyPI on a version tag.
#
# Publishing uses PyPI Trusted Publishing (OIDC) — there is NO API token to manage.
# One-time setup before the first release: on PyPI, add a Trusted Publisher for this
# repo pointing at workflow `wheels.yml` and environment `pypi`
# (https://docs.pypi.org/trusted-publishers/). Until that exists, the build jobs still
# run on every push/PR; only the final `release` job needs it, and it runs only on tags.
#
# The wheel matrix is deliberately lean (the common student/dev platforms). Any platform
# without a wheel falls back to the sdist and builds from source (needs Rust). To widen
# coverage, regenerate the full skeleton with: maturin generate-ci github
name: wheels
on:
push:
branches: [main]
tags: ['*']
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: wheels-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: auto
- uses: actions/upload-artifact@v6
with:
name: wheels-linux-${{ matrix.target }}
path: dist
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: x64
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- uses: actions/upload-artifact@v6
with:
name: wheels-windows-x64
path: dist
macos:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: macos-15-intel
target: x86_64
- runner: macos-latest
target: aarch64
steps:
- uses: actions/checkout@v6
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- uses: actions/upload-artifact@v6
with:
name: wheels-macos-${{ matrix.target }}
path: dist
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- uses: actions/upload-artifact@v6
with:
name: wheels-sdist
path: dist
release:
name: Publish to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [linux, windows, macos, sdist]
environment: pypi
permissions:
id-token: write # OIDC token for Trusted Publishing
attestations: write # sign the build artifacts
contents: read
steps:
- uses: actions/download-artifact@v7
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: 'dist/*'
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
# Package the VS Code extension and attach the .vsix to the GitHub Release for
# this tag. The Marketplace publish itself stays manual (drag the .vsix into
# https://marketplace.visualstudio.com/manage/publishers/pyfun). CLI publishing
# is a dead end here (see the vsce --azure-credential bug). The vsix carries the
# version from editors/vscode/package.json, not the tag, so bumping it is step 1
# of RELEASING.md — every release, whether or not the client itself changed, so
# that a user comparing the extension against `pyfun --version` sees one number.
vscode-extension:
name: Package VS Code extension
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write # create the Release and upload the .vsix asset
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Package the extension
working-directory: editors/vscode
run: |
npm install
npx --yes @vscode/vsce package
- name: Attach the .vsix to the GitHub Release
uses: softprops/action-gh-release@v2
with:
files: editors/vscode/*.vsix