From 764b621f6e48bacedf7296c604446494ea24b149 Mon Sep 17 00:00:00 2001 From: yun Date: Mon, 14 Oct 2024 23:49:08 -0700 Subject: [PATCH] change version: for release canndidate: binary: sling version: 1.2.20-rc{1,2,3...}-timeplus for final release: binary: sling version: 1.2.20-timeplus --- .github/workflows/release.yml | 15 ++++++++++++++- .goreleaser.yml | 7 +++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9792f797..249dd912 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: version: - description: 'Version number for this release (e.g., v1.0.0)' + description: 'Version number for this release (e.g., v1.0.0 or v1.0.0-rc1)' required: true default: 'v1.0.0' @@ -25,6 +25,18 @@ jobs: with: go-version: '1.22' # Adjust this to your Go version + - name: Set release version + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + git config user.name github-action + git config user.email github-actions@github.com + git tag ${{ github.event.inputs.version }} + git push origin ${{ github.event.inputs.version }} + else + echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + fi + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5 with: @@ -33,6 +45,7 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_CURRENT_TAG: ${{ env.RELEASE_VERSION }} - name: Upload artifacts uses: actions/upload-artifact@v3 diff --git a/.goreleaser.yml b/.goreleaser.yml index c308f127..50154cc8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,4 +1,4 @@ -project_name: sling-timeplus +project_name: sling before: hooks: @@ -20,8 +20,10 @@ builds: - amd64 - arm64 ldflags: - - "-X 'github.com/slingdata-io/sling-cli/core.Version={{.Version}}'" + - "-X 'github.com/slingdata-io/sling-cli/core.Version={{.Version}}-timeplus'" +git: + prerelease_suffix: "-rc" archives: - format: zip name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' @@ -41,6 +43,7 @@ changelog: - '^test:' release: + prerelease: auto github: owner: timeplus-io name: sling-cli