diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38c3828..8ec6a03 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..0861275 --- /dev/null +++ b/.goreleaser.yaml @@ -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