remove useless build_for_macos.yml #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
tags: | |
- 'v*' | |
name: Create Release | |
jobs: | |
create_release: | |
name: Create new release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: ${{ github.ref }} | |
- name: Create Release | |
run: bash tools/create_release.sh ${{ github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
build_for_macosx: | |
needs: [create_release] | |
name: Build for MacOSX | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: ${{github.ref}} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- run: | | |
export VERSION=$(cat ./version) | |
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 | |
tar zcvf out/aliyun-cli-macosx-${VERSION}-amd64.tgz -C out aliyun | |
# generate out/aliyun-cli-${VERSION}.pkg | |
sh tools/build_pkg.sh ${VERSION} | |
build_for_linux: | |
needs: [create_release] | |
name: Build for Linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: ${{github.ref}} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- run: | | |
export VERSION=$(cat ./version) | |
# 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 | |
# build for Linux arm64 | |
GOOS=linux GOARCH=arm64 go build -ldflags "-X 'github.com/aliyun/aliyun-cli/cli.Version=${VERSION}'" -o out/aliyun main/main.go`, cliDir) | |
tar zcvf out/aliyun-cli-linux-${VERSION}-arm64.tgz -C out aliyun | |
build_for_windows: | |
needs: [create_release] | |
name: Build for Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: ${{github.ref}} | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- run: | | |
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: | |
needs: [build_for_macosx, build_for_linux, build_for_windows] | |
name: Build for Windows | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
echo "finished" |