Skip to content

Commit

Permalink
release action
Browse files Browse the repository at this point in the history
  • Loading branch information
arttor committed Apr 30, 2024
1 parent ba222dc commit 1c2ffb8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 52 deletions.
55 changes: 9 additions & 46 deletions .github/workflows/ci-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,15 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
# - uses: actions/checkout@v4
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version: "1.21"
- uses: actions/checkout@v4
- uses: actions/setup-go@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"
- name: Install zip
uses: montudor/action-zip@v1
- name: Build standalone binaries
run: |
mkdir standalone
platforms=("darwin/amd64" "darwin/arm64" "linux/386" "linux/amd64" "linux/arm64" "windows/amd64" "windows/386" )
for platform in "${platforms[@]}"
do
platform_split=(${platform//\// })
GOOS=${platform_split[0]}
GOARCH=${platform_split[1]}
bin_name='chorus'
output_name='standalone_''v0.1.0''_'$GOOS'_'$GOARCH
# output_name='standalone_'${{ github.ref_name }}'_'$GOOS'_'$GOARCH
if [ $GOOS = "windows" ]; then
bin_name+='.exe'
output_name+='.zip'
else
output_name+='.tar.gz'
fi
env GOOS=$GOOS GOARCH=$GOARCH go build -o $bin_name ./cmd/chorus
if [ $? -ne 0 ]; then
echo 'An error has occurred! Aborting the script execution...'
exit 1
fi
if [ $GOOS = "windows" ]; then
zip -r standalone/$output_name ./$bin_name
else
tar -cvzf standalone/$output_name ./$bin_name
fi
rm ./$bin_name
done
#
# - name: Fmt
# run: go fmt ./...
# - name: Vet
# run: go vet ./...
# - name: Test
# run: go test ./...

- name: Fmt
run: go fmt ./...
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ jobs:
done
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: v5.0.0
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BREW_RELEASE_TOKEN: ${{ secrets.BREW_RELEASE_TOKEN }}
5 changes: 2 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ checksum:
name_template: checksums.txt
brews:
- name: chorctl
app: chorctl
tap:
repository:
owner: clyso
name: homebrew-tap
token: '{{ .Env.BREW_RELEASE_TOKEN }}'
commit_author:
name: clyso_bot
email: [email protected]
Expand All @@ -47,7 +47,6 @@ brews:
system "#{bin}/chorctl --version"
install: |
bin.install "chorctl"
token: '{{ .Env.BREW_RELEASE_TOKEN }}'
release:
github:
owner: clyso
Expand Down

0 comments on commit 1c2ffb8

Please sign in to comment.