ci: trigger release build on published release instead of tag push
Both workflows now run on `release: published` and attach the built archives to the release the user creates, rather than pushing a tag and having the workflow create the release. Tag comes from the release event; GitHub no longer regenerates release notes. Docs updated accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,9 +11,8 @@ name: Release
|
||||
# Settings -> Actions -> Secrets. Without it the build still runs; only the
|
||||
# upload step is skipped.
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -71,8 +70,9 @@ jobs:
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
- name: Derive version
|
||||
# On a tag push, strip the leading "v" so artifact names and the injected
|
||||
# app version match the release tag.
|
||||
# On a release, strip the leading "v" so artifact names and the injected
|
||||
# app version match the release tag (the release event still sets
|
||||
# GITHUB_REF_TYPE=tag / GITHUB_REF_NAME=<tag>).
|
||||
id: version
|
||||
run: |
|
||||
if [ "${GITHUB_REF_TYPE:-}" = "tag" ]; then
|
||||
@@ -93,14 +93,16 @@ jobs:
|
||||
mkdir -p dist/release
|
||||
cp dist/linux/*.tar.gz dist/windows/*.zip dist/release/
|
||||
|
||||
- name: Publish release
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
- name: Attach assets to release
|
||||
# Only runs for the release event; the release already exists, so this
|
||||
# uploads the built archives to it. Skipped on workflow_dispatch.
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
uses: https://code.forgejo.org/actions/forgejo-release@v2
|
||||
with:
|
||||
direction: upload
|
||||
url: https://codeberg.org
|
||||
repo: ${{ github.repository }}
|
||||
tag: ${{ github.ref_name }}
|
||||
tag: ${{ github.event.release.tag_name }}
|
||||
release-dir: dist/release
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
override: true
|
||||
|
||||
Reference in New Issue
Block a user