e6dl/.github/workflows/release.yml

36 lines
1.2 KiB
YAML
Raw Normal View History

2020-02-22 03:55:59 +08:00
name: Build and publish release binaries
on:
release:
types: [created]
jobs:
build-publish:
name: Build and publish
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
2020-02-22 03:55:59 +08:00
uses: actions/setup-go@v1
with:
go-version: 1.14
2020-02-22 03:55:59 +08:00
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get dependencies
run: go get -v -t -d ./...
- name: Build binaries
run: |
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o ./e6dl-windows-amd64.exe .
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o ./e6dl-darwin-amd64 .
2022-05-06 02:02:35 +08:00
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o ./e6dl-darwin-arm64 .
2020-02-22 03:55:59 +08:00
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./e6dl-linux-amd64 .
2022-05-06 02:02:35 +08:00
GOOS=linux GOARCH=ppc64 go build -ldflags="-s -w" -o ./e6dl-linux-ppc64 .
- name: Compress binaries with upx
run: |
2020-04-24 06:45:25 +08:00
sudo apt-get install -y upx
2022-05-06 02:02:35 +08:00
upx e6dl-windows-amd64.exe e6dl-darwin-amd64 e6dl-darwin-arm64 e6dl-linux-amd64 e6dl-linux-ppc64
2020-02-22 03:55:59 +08:00
- name: Upload binaries
uses: skx/github-action-publish-binaries@release-1.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: 'e6dl-*'