From 1306d64e2c6d9722248dc9214c25ac96f00d339c Mon Sep 17 00:00:00 2001 From: James Ding Date: Sat, 23 May 2026 23:15:28 -0700 Subject: [PATCH 1/4] ci: add release-please config and manifest --- .release-please-manifest.json | 3 +++ release-please-config.json | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..9049e2f --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.3.1" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..6febccc --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "go", + "extra-files": ["main.go"] + } + } +} From 82f2ca53e24cfb11878fc6061153fb9ac9358503 Mon Sep 17 00:00:00 2001 From: James Ding Date: Sat, 23 May 2026 23:16:30 -0700 Subject: [PATCH 2/4] chore: annotate version const for release-please and bump to v1.3.1 --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index a927ad8..6baeb1c 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( ) const name = "lfm-cli" -const version = "v1.3.0" +const version = "v1.3.1" // x-release-please-version const discordAppId = "970003417277812736" From 71866cbb66075dac7da74f06a8a7dd5c9a81c99c Mon Sep 17 00:00:00 2001 From: James Ding Date: Sat, 23 May 2026 23:18:15 -0700 Subject: [PATCH 3/4] ci: rename build workflow to go and add release-please job --- .github/workflows/{build.yml => go.yml} | 14 +++++++++++++- README.md | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) rename .github/workflows/{build.yml => go.yml} (87%) diff --git a/.github/workflows/build.yml b/.github/workflows/go.yml similarity index 87% rename from .github/workflows/build.yml rename to .github/workflows/go.yml index fc8c36d..ebda8ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/go.yml @@ -1,4 +1,4 @@ -name: Build and Release +name: Go on: push: @@ -87,6 +87,18 @@ jobs: name: lfm-cli-${{ matrix.name }} path: lfm-cli-* + release-please: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: googleapis/release-please-action@v4 + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + release: needs: build if: github.event_name == 'release' diff --git a/README.md b/README.md index 7785225..5da9ca2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@

GitHub all releases - +

From 61049be769c6e9d868a5ad05fe1d2bdfa836180e Mon Sep 17 00:00:00 2001 From: James Ding Date: Sat, 23 May 2026 23:28:05 -0700 Subject: [PATCH 4/4] ci: build on every push, gate release upload on release-please outputs Build matrix runs in parallel with release-please (restoring per-push CI). The release job consumes those attested artifacts and uploads them only when release-please cuts a release. Binary version is sourced from the main.go const (kept in sync by release-please) so release assets match the tag. --- .github/workflows/go.yml | 43 +++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ebda8ac..df9d9f5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,10 +2,24 @@ name: Go on: push: - release: - types: [published] jobs: + release-please: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + build: runs-on: ubuntu-latest permissions: @@ -63,7 +77,11 @@ jobs: - uses: actions/checkout@v6 - name: Set binary name - run: echo "BINARY_NAME=lfm-cli-${{ matrix.name }}-${{ github.ref_name }}${{ matrix.ext }}" >> $GITHUB_ENV + # Version comes from the const in main.go, which release-please keeps in + # sync; on a release-PR merge it already holds the version being tagged. + run: | + VERSION=$(sed -n 's/^const version = "\([^"]*\)".*/\1/p' main.go) + echo "BINARY_NAME=lfm-cli-${{ matrix.name }}-${VERSION}${{ matrix.ext }}" >> $GITHUB_ENV - name: Set up Go uses: actions/setup-go@v6 @@ -87,21 +105,9 @@ jobs: name: lfm-cli-${{ matrix.name }} path: lfm-cli-* - release-please: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - uses: googleapis/release-please-action@v4 - with: - config-file: release-please-config.json - manifest-file: .release-please-manifest.json - release: - needs: build - if: github.event_name == 'release' + needs: [release-please, build] + if: needs.release-please.outputs.release_created == 'true' runs-on: ubuntu-latest permissions: contents: write @@ -115,5 +121,6 @@ jobs: - name: Upload to release uses: softprops/action-gh-release@v2 with: + tag_name: ${{ needs.release-please.outputs.tag_name }} files: | - artifacts/lfm-cli-* \ No newline at end of file + artifacts/lfm-cli-*