Skip to content

Fix/last frame and default n print #116

Fix/last frame and default n print

Fix/last frame and default n print #116

Workflow file for this run

name: Version Bump
on:
workflow_dispatch:
pull_request:
types: [closed]
branches: [main]
jobs:
bump-version:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'release'))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: prefix-dev/setup-pixi@v0.8.8
with:
locked: false # this workflow regenerates the lock; other workflows keep locked: true
- name: Update release drafter draft
# Run release-drafter here to avoid a race condition: merging a PR fires
# both push→main (release-drafter workflow) and pull_request→closed (this
# workflow) simultaneously. By invoking it explicitly first, we guarantee
# the draft reflects the just-merged PR before we read the resolved version.
uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get next version from release drafter draft
id: version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
# The release drafter maintains a draft release whose tag is the resolved next version
VERSION=$(gh api repos/${{ github.repository }}/releases \
--jq '[.[] | select(.draft)] | first | .tag_name' | sed 's/^v//')
if [ -z "$VERSION" ] || [ "$VERSION" = "null" ]; then
echo "::error::No draft release found. Has release-drafter run at least once?"
exit 1
fi
echo "Next version from release drafter: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Update pyproject.toml
run: sed -i "s/^version = \".*\"/version = \"${{ steps.version.outputs.version }}\"/" pyproject.toml
- name: Update pixi.lock
run: pixi install
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore: bump version to ${{ steps.version.outputs.version }}"
title: "chore: bump version to ${{ steps.version.outputs.version }}"
branch: chore/version-bump-${{ steps.version.outputs.version }}
delete-branch: true
labels: skip-changelog
tag-release:
if: |
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.title, 'chore: bump version to ')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Extract version and create tag
run: |
set -e
VERSION=$(grep -oP 'version = "\K[^"]+' pyproject.toml | head -1)
echo "Tagging v$VERSION"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "v$VERSION"
git push origin "v$VERSION"