mirror of
https://github.com/NohamR/papeer.git
synced 2026-05-24 20:00:45 +00:00
feat: ci release go binaries
This commit is contained in:
18
.github/workflows/release.yml
vendored
Normal file
18
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
releases-matrix:
|
||||
name: Release Go Binary
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
goos: [linux, darwin, windows]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: wangyoucao577/go-release-action@v1.30
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
goos: ${{ matrix.goos }}
|
||||
goarch: amd64
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -4,6 +4,8 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- '**.go'
|
||||
- 'go.mod'
|
||||
- 'go.sum'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
||||
27
release.sh
27
release.sh
@@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Illegal number of parameters"
|
||||
echo "Usage: ./release.sh X.X.X"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
version=$1
|
||||
platforms=("linux/amd64" "darwin/amd64" "windows/amd64")
|
||||
|
||||
for platform in "${platforms[@]}"
|
||||
do
|
||||
platform_split=(${platform//\// })
|
||||
GOOS=${platform_split[0]}
|
||||
GOARCH=${platform_split[1]}
|
||||
|
||||
if [ $GOOS = "windows" ]; then
|
||||
env GOOS=$GOOS GOARCH=$GOARCH go build -o papeer.exe
|
||||
zip "papeer-v$version-$GOOS-$GOARCH.exe.zip" papeer.exe
|
||||
rm papeer.exe
|
||||
else
|
||||
env GOOS=$GOOS GOARCH=$GOARCH go build -o papeer
|
||||
tar czvf "papeer-v$version-$GOOS-$GOARCH.tar.gz" papeer
|
||||
rm papeer
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user