mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-05 16:15:43 +00:00
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '_docs/**'
|
|
- 'README.md'
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: '^1.18'
|
|
- uses: actions/checkout@v3
|
|
- uses: release-drafter/release-drafter@v5
|
|
id: create_release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Build
|
|
env:
|
|
VERSION: ${{ steps.create_release.outputs.tag_name }}
|
|
run: |
|
|
mkdir -p dist/zip
|
|
goos_arr=(windows darwin linux)
|
|
goarch_arr=(386 amd64 arm arm64)
|
|
export CGO_ENABLED=0
|
|
for goos in "${goos_arr[@]}"; do
|
|
for goarch in "${goarch_arr[@]}"; do
|
|
dir="dist/gopeed-$VERSION-$goos-$goarch/"
|
|
(GOOS=$goos GOARCH=$goarch go build -tags nosqlite -ldflags="-s -w" -o $dir github.com/monkeyWie/gopeed-core/cmd/gopeed \
|
|
&& cd $dir \
|
|
&& zip -r ../zip/gopeed-$VERSION-$goos-$goarch.zip * \
|
|
&& cd ../..) \
|
|
|| true
|
|
done
|
|
done
|
|
- name: Upload
|
|
uses: shogo82148/actions-upload-release-asset@v1
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: dist/zip/*
|