From 4c9150a171398476ae234ab72da4b36971275f04 Mon Sep 17 00:00:00 2001 From: BinBin He Date: Thu, 27 Nov 2025 03:45:35 -0800 Subject: [PATCH 1/2] Run release workflow only on tags --- .github/workflows/go.yml | 4 ++-- .github/workflows/release.yml | 3 +-- go.mod | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0b443f3..83a4ad6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,9 +17,9 @@ jobs: - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version: '1.25' - name: Build run: go build -v ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 338b4cb..176bb1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,6 @@ name: Release on: push: - branches: [main] tags: ['v*'] release: types: [published] @@ -45,7 +44,7 @@ jobs: with: # Use a pinned Go version instead of parsing go.mod to avoid # failing on unsupported prerelease versions in the module file. - go-version: '1.23' + go-version: '1.25' - name: Download dependencies run: go mod download diff --git a/go.mod b/go.mod index b069fab..48cb2b0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/binsquare/envmap -go 1.23 +go 1.25 require ( github.com/1Password/connect-sdk-go v1.5.0 From d09cd95f75b589b15f8de9519a7a655283ecbca7 Mon Sep 17 00:00:00 2001 From: BinBin He Date: Thu, 27 Nov 2025 03:48:50 -0800 Subject: [PATCH 2/2] Add automatic tagging on main merges --- .github/workflows/tag-on-merge.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/tag-on-merge.yml diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml new file mode 100644 index 0000000..d9580a1 --- /dev/null +++ b/.github/workflows/tag-on-merge.yml @@ -0,0 +1,30 @@ +name: Tag for release on merge + +on: + push: + branches: ["main"] + +permissions: + contents: write + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate tag name + id: tag + run: | + TAG="v$(date -u +%Y.%m.%d.%H%M%S)" + echo "tag=$TAG" >> "$GITHUB_OUTPUT" + + - name: Create tag on merge commit + env: + TAG_NAME: ${{ steps.tag.outputs.tag }} + run: | + git tag "$TAG_NAME" "$GITHUB_SHA" + git push origin "$TAG_NAME"