From ed63c0ada5a209eabadcbcf332d1f541fcbc38fa Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Tue, 7 Jul 2026 10:56:17 +0100 Subject: [PATCH 1/6] ci: allow manual prerelease runs --- .github/workflows/ci.yml | 9 +++++++++ .github/workflows/release.yml | 23 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7348a69..b3b4d9fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,11 @@ on: pull_request: branches: [ main ] workflow_call: + inputs: + checkout-ref: + required: false + type: string + default: '' concurrency: group: ci-${{ github.head_ref || github.run_id }} @@ -17,6 +22,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + ref: ${{ inputs.checkout-ref || github.ref }} - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: @@ -46,6 +53,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + with: + ref: ${{ inputs.checkout-ref || github.ref }} - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39a56e48..7888c45a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,17 @@ on: push: tags: - v[0-9].[0-9]+.[0-9]+ + workflow_dispatch: + inputs: + release-tag: + description: Release tag, for example v1.2.3 + required: true + type: string + pre-release: + description: Pre-release + required: false + type: boolean + default: false concurrency: group: release-${{ github.head_ref || github.run_id }} @@ -15,15 +26,18 @@ permissions: jobs: ci: uses: ./.github/workflows/ci.yml + with: + checkout-ref: ${{ inputs['release-tag'] || github.ref }} secrets: inherit release: needs: ci runs-on: ubuntu-latest - steps: + steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: fetch-depth: 0 + ref: ${{ inputs['release-tag'] || github.ref }} - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: go-version-file: 'go.mod' @@ -34,3 +48,10 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_CURRENT_TAG: ${{ inputs['release-tag'] || github.ref_name }} + - name: Mark release as pre-release + if: ${{ inputs['pre-release'] }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_TAG: ${{ inputs['release-tag'] || github.ref_name }} + run: gh release edit "$RELEASE_TAG" --prerelease From 08d39014b2edb1698734907cfab1d6ba07f54fb9 Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Tue, 7 Jul 2026 11:50:06 +0100 Subject: [PATCH 2/6] ci: document checkout ref input --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3b4d9fd..981a9829 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: workflow_call: inputs: checkout-ref: + description: Git ref to check out when this workflow is called by another workflow. required: false type: string default: '' From a9b9c3b190b7aa4388f246340a0b421ea0239a77 Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Tue, 7 Jul 2026 11:52:13 +0100 Subject: [PATCH 3/6] ci: configure prereleases in goreleaser --- .github/workflows/release.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7888c45a..86db2570 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,17 +41,23 @@ jobs: - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: go-version-file: 'go.mod' + - name: Configure GoReleaser release type + env: + PRE_RELEASE: ${{ inputs['pre-release'] || false }} + run: | + cp .goreleaser.yaml .goreleaser.release.yaml + if [ "$PRE_RELEASE" = "true" ]; then + { + printf '\n' + printf 'release:\n' + printf ' prerelease: true\n' + } >> .goreleaser.release.yaml + fi - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 with: distribution: goreleaser version: '~> v2' - args: release --clean + args: release --clean --config .goreleaser.release.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GORELEASER_CURRENT_TAG: ${{ inputs['release-tag'] || github.ref_name }} - - name: Mark release as pre-release - if: ${{ inputs['pre-release'] }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_TAG: ${{ inputs['release-tag'] || github.ref_name }} - run: gh release edit "$RELEASE_TAG" --prerelease From 35d7849be0010a024165b05b7daa474adc2161ca Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Tue, 7 Jul 2026 16:56:13 +0100 Subject: [PATCH 4/6] add prerelease go release file --- .github/workflows/release.yml | 14 ++++----- .goreleaser.prerelease.yaml | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .goreleaser.prerelease.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86db2570..e134ae74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,23 +41,21 @@ jobs: - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: go-version-file: 'go.mod' - - name: Configure GoReleaser release type + - name: Select GoReleaser config + id: goreleaser-config env: PRE_RELEASE: ${{ inputs['pre-release'] || false }} run: | - cp .goreleaser.yaml .goreleaser.release.yaml if [ "$PRE_RELEASE" = "true" ]; then - { - printf '\n' - printf 'release:\n' - printf ' prerelease: true\n' - } >> .goreleaser.release.yaml + echo "config=.goreleaser.prerelease.yaml" >> "$GITHUB_OUTPUT" + else + echo "config=.goreleaser.yaml" >> "$GITHUB_OUTPUT" fi - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 with: distribution: goreleaser version: '~> v2' - args: release --clean --config .goreleaser.release.yaml + args: release --clean --config ${{ steps.goreleaser-config.outputs.config }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GORELEASER_CURRENT_TAG: ${{ inputs['release-tag'] || github.ref_name }} diff --git a/.goreleaser.prerelease.yaml b/.goreleaser.prerelease.yaml new file mode 100644 index 00000000..64511bc9 --- /dev/null +++ b/.goreleaser.prerelease.yaml @@ -0,0 +1,57 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - id: containerd-shim-remoteproc-v1 + main: ./cmd/containerd-shim-remoteproc-v1 + binary: containerd-shim-remoteproc-v1 + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - arm64 + ldflags: + - -s -w + - -X github.com/arm/remoteproc-runtime/internal/version.Version={{.Version}} + - -X github.com/arm/remoteproc-runtime/internal/version.GitCommit={{.Commit}} + - id: remoteproc-runtime + main: ./cmd/remoteproc-runtime + binary: remoteproc-runtime + env: + - CGO_ENABLED=0 + goos: + - linux + goarch: + - arm64 + ldflags: + - -s -w + - -X github.com/arm/remoteproc-runtime/internal/version.Version={{.Version}} + - -X github.com/arm/remoteproc-runtime/internal/version.GitCommit={{.Commit}} + +release: + prerelease: true + +archives: + - formats: [tar.gz] + name_template: "remoteproc-runtime_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - README.md + - docs/* + +checksum: + name_template: "checksums.txt" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + - "^refactor:" From f7c0cd1deeb7d06f6378b1a113d5cc6c89b6b237 Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Wed, 8 Jul 2026 09:52:26 +0100 Subject: [PATCH 5/6] leverage goreleaser's pre-release feature --- .github/workflows/release.yml | 13 ++++---- .goreleaser.prerelease.yaml | 57 ----------------------------------- .goreleaser.yaml | 3 ++ 3 files changed, 10 insertions(+), 63 deletions(-) delete mode 100644 .goreleaser.prerelease.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e134ae74..2dbc9ada 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,21 +41,22 @@ jobs: - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: go-version-file: 'go.mod' - - name: Select GoReleaser config - id: goreleaser-config + - name: Check release tag for pre-release env: PRE_RELEASE: ${{ inputs['pre-release'] || false }} + RELEASE_TAG: ${{ inputs['release-tag'] || github.ref_name }} run: | if [ "$PRE_RELEASE" = "true" ]; then - echo "config=.goreleaser.prerelease.yaml" >> "$GITHUB_OUTPUT" - else - echo "config=.goreleaser.yaml" >> "$GITHUB_OUTPUT" + if [[ ! "$RELEASE_TAG" =~ -rc[0-9]+$ ]]; then + echo "::error::Pre-release tags must end with -rc, for example v1.2.3-rc1" + exit 1 + fi fi - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 with: distribution: goreleaser version: '~> v2' - args: release --clean --config ${{ steps.goreleaser-config.outputs.config }} + args: release --clean --config .goreleaser.yaml env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GORELEASER_CURRENT_TAG: ${{ inputs['release-tag'] || github.ref_name }} diff --git a/.goreleaser.prerelease.yaml b/.goreleaser.prerelease.yaml deleted file mode 100644 index 64511bc9..00000000 --- a/.goreleaser.prerelease.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# yaml-language-server: $schema=https://goreleaser.com/static/schema.json -# vim: set ts=2 sw=2 tw=0 fo=cnqoj - -version: 2 - -before: - hooks: - - go mod tidy - -builds: - - id: containerd-shim-remoteproc-v1 - main: ./cmd/containerd-shim-remoteproc-v1 - binary: containerd-shim-remoteproc-v1 - env: - - CGO_ENABLED=0 - goos: - - linux - goarch: - - arm64 - ldflags: - - -s -w - - -X github.com/arm/remoteproc-runtime/internal/version.Version={{.Version}} - - -X github.com/arm/remoteproc-runtime/internal/version.GitCommit={{.Commit}} - - id: remoteproc-runtime - main: ./cmd/remoteproc-runtime - binary: remoteproc-runtime - env: - - CGO_ENABLED=0 - goos: - - linux - goarch: - - arm64 - ldflags: - - -s -w - - -X github.com/arm/remoteproc-runtime/internal/version.Version={{.Version}} - - -X github.com/arm/remoteproc-runtime/internal/version.GitCommit={{.Commit}} - -release: - prerelease: true - -archives: - - formats: [tar.gz] - name_template: "remoteproc-runtime_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - files: - - README.md - - docs/* - -checksum: - name_template: "checksums.txt" - -changelog: - sort: asc - filters: - exclude: - - "^docs:" - - "^test:" - - "^refactor:" diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 9dadb06e..9f651780 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -35,6 +35,9 @@ builds: - -X github.com/arm/remoteproc-runtime/internal/version.Version={{.Version}} - -X github.com/arm/remoteproc-runtime/internal/version.GitCommit={{.Commit}} +release: + prerelease: auto + archives: - formats: [tar.gz] name_template: "remoteproc-runtime_{{ .Version }}_{{ .Os }}_{{ .Arch }}" From f1591d5555d9d2378f477e0c27ca47eaa5e514d2 Mon Sep 17 00:00:00 2001 From: Yejin Seo Date: Wed, 8 Jul 2026 09:56:27 +0100 Subject: [PATCH 6/6] ci: derive prerelease state from tag --- .github/workflows/release.yml | 18 +----------------- docs/DEVELOPMENT.md | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2dbc9ada..2b7e4f6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,14 +7,9 @@ on: workflow_dispatch: inputs: release-tag: - description: Release tag, for example v1.2.3 + description: Release tag, for example v1.2.3 or v1.2.3-rc1 required: true type: string - pre-release: - description: Pre-release - required: false - type: boolean - default: false concurrency: group: release-${{ github.head_ref || github.run_id }} @@ -41,17 +36,6 @@ jobs: - uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 with: go-version-file: 'go.mod' - - name: Check release tag for pre-release - env: - PRE_RELEASE: ${{ inputs['pre-release'] || false }} - RELEASE_TAG: ${{ inputs['release-tag'] || github.ref_name }} - run: | - if [ "$PRE_RELEASE" = "true" ]; then - if [[ ! "$RELEASE_TAG" =~ -rc[0-9]+$ ]]; then - echo "::error::Pre-release tags must end with -rc, for example v1.2.3-rc1" - exit 1 - fi - fi - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 with: distribution: goreleaser diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 9b38cafd..1b4d7f02 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -189,7 +189,7 @@ PRs must have semantic commit titles (enforced by GitHub Actions). ### Releases -Releases are automated using GoReleaser when a new tag is pushed: +Releases are automated using GoReleaser when a release tag is pushed: ```bash # Create and push a new version tag @@ -204,3 +204,22 @@ The release workflow will: 1. Build binaries for multiple platforms 1. Create a GitHub release with artifacts + +You can also start the release from GitHub Actions: + +1. Open the **Release** workflow. + +1. Select **Run workflow**. + +1. Enter the release tag, for example `v0.1.0` or `v0.1.0-rc1`. + +To create a pre-release, use an `-rc` tag: + +```bash +git tag v0.1.0-rc1 +git push origin v0.1.0-rc1 +``` + +Then run the **Release** workflow with **release-tag** set to `v0.1.0-rc1`. +GoReleaser marks the GitHub release as a pre-release automatically from the +tag.