Skip to content

更新action编排,自动替换版本号 #11

更新action编排,自动替换版本号

更新action编排,自动替换版本号 #11

Workflow file for this run

name: go-releaser
permissions:
contents: write
id-token: write
packages: write
on:
push:
tags: [ 'v*' ]
jobs:
goreleaser:
runs-on: ubuntu-latest
env:
flags: ''
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
cache: true
- name: Replace version in version.go
run: |
tag=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
sed -i "s/const RuntimeVersion = \".*\"/const RuntimeVersion = \"$tag\"/" app/version.go
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean ${{ env.flags }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}