Skip to content

Commit

Permalink
ci: add goreleaser for cross compile
Browse files Browse the repository at this point in the history
  • Loading branch information
shinebayar-g committed Dec 27, 2021
1 parent 2c2d387 commit 30adac5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Checkout code
uses: actions/checkout@v2
- name: Verification
run: go mod verify
- name: Build
run: go build -o ufw-docker-automated github.com/shinebayar-g/ufw-docker-automated
- name: Release
uses: softprops/action-gh-release@v1
go-version: 1.17

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
files: ufw-docker-automated
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
before:
hooks:
- go mod tidy

builds:
- binary: ufw-docker-automated
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm
- arm64
goarm:
- 6
- 7

0 comments on commit 30adac5

Please sign in to comment.