Files
Crosspoint/.github/workflows/release_candidate.yml
T
Joel Goguen 0010b200ed feat(gha): Auto-publish releases
- GHA release workflow is updated to use an action for uploading all assets. The
	action docs say it updates a release if one already exists, and since this
	triggers on release and we pass a release tag we know the release already
	exists.
- GHA release candidate workflow is updated to auto-publish a pre-release
	release on push to a `release/**` branch. A script is added and used to
	generate a release message made up of the commits since the last release of
	any kind.
- ACT profiles are added to allow locally testing these workflows without
	needing to push and wait for GHA to run.
- Docs are updated to note how to test the workflows locally.
2026-04-23 22:48:41 -04:00

75 lines
2.3 KiB
YAML

name: Publish Release Candidate
on:
push:
branches:
- "release/**"
permissions:
contents: write
jobs:
build-release-candidate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
enable-cache: false
- name: Install PlatformIO Core
run: uv pip install --system -U https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.19.zip
- name: Extract env
run: |
echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
echo "BRANCH_SUFFIX=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV
echo "RC_TAG=${GITHUB_REF_NAME#release/}-rc.${GITHUB_RUN_NUMBER}.${GITHUB_RUN_ATTEMPT}" >> $GITHUB_ENV
echo "RELEASE_NOTES_PATH=${RUNNER_TEMP}/release-notes.md" >> $GITHUB_ENV
- name: Build CrossPoint Release Candidate
env:
CROSSPOINT_RC_HASH: ${{ env.SHORT_SHA }}
run: pio run -e gh_release_rc
- name: Patch min_chip_rev_full to 0
run: python3 scripts/patch_min_chip_rev.py .pio/build/gh_release_rc/firmware.bin
- name: Generate release notes
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
python3 scripts/generate_release_notes.py \
--output "${RELEASE_NOTES_PATH}" \
--target-sha "${GITHUB_SHA}" \
--current-label "${RC_TAG}" \
--release-scope any \
--exclude-tag "${RC_TAG}"
- name: Publish prerelease assets
if: ${{ env.ACT != 'true' }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RC_TAG }}
target_commitish: ${{ github.sha }}
name: CrossPoint ${{ env.RC_TAG }}
body_path: ${{ env.RELEASE_NOTES_PATH }}
prerelease: true
files: |
.pio/build/gh_release_rc/bootloader.bin
.pio/build/gh_release_rc/firmware.bin
.pio/build/gh_release_rc/firmware.elf
.pio/build/gh_release_rc/firmware.map
.pio/build/gh_release_rc/partitions.bin
fail_on_unmatched_files: true