Skip to content

Commit

Permalink
remove v from tag name
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonTian committed Aug 16, 2023
1 parent cdee97b commit c185220
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
ref: ${{ github.ref }}
- name: Create Release
run: |
bash tools/create_release.sh $VERSION
bash tools/create_release.sh ${{ github.ref_name }}
build_for_macosx:
needs: [create_release]
name: Build for MacOSX
runs-on: macos-12
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -37,6 +35,8 @@ jobs:
go-version: '1.20'
- name: Build
run: |
TAG=${{ github.ref_name }}
VERSION=${TAG#v}
GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'github.com/aliyun/aliyun-cli/cli.Version=${VERSION}'" -o out/aliyun.amd64 main/main.go
GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'github.com/aliyun/aliyun-cli/cli.Version=${VERSION}'" -o out/aliyun.arm64 main/main.go
lipo -output out/aliyun -create out/aliyun.amd64 out/aliyun.arm64
Expand All @@ -51,7 +51,6 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -63,6 +62,8 @@ jobs:
go-version: '1.20'
- name: Build
run: |
TAG=${{ github.ref_name }}
VERSION=${TAG#v}
# build for Linux amd64
GOOS=linux GOARCH=amd64 go build -ldflags "-X 'github.com/aliyun/aliyun-cli/cli.Version=${VERSION}'" -o out/aliyun main/main.go
tar zcvf out/aliyun-cli-linux-${VERSION}-amd64.tgz -C out aliyun
Expand All @@ -77,7 +78,6 @@ jobs:
runs-on: windows-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -89,6 +89,8 @@ jobs:
go-version: '1.20'
- name: Build
run: |
TAG=${{ github.ref_name }}
VERSION=${TAG#v}
GOOS=windows GOARCH=amd64 go build -ldflags "-X 'github.com/aliyun/aliyun-cli/cli.Version=${VERSION}'" -o aliyun.exe main/main.go
zip -r out/aliyun-cli-windows-${VERSION}-amd64.zip aliyun.exe
finish_release:
Expand Down

0 comments on commit c185220

Please sign in to comment.