diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index d4e8199..778e6c6 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,18 +7,55 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.13 + - name: Set up Go 1.16 uses: actions/setup-go@v1 with: - go-version: 1.13 + go-version: 1.16 id: go - name: Check out code into the Go module directory uses: actions/checkout@v1 - - name: Get dependencies - run: | - go get -v -t -d ./... + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: --snapshot --skip-publish --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build - run: go build -v . + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: Windows 64-bit + path: dist/packwiz_windows_amd64/ + + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: Windows 32-bit + path: dist/packwiz_windows_386/ + + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: Linux 64-bit x86 + path: dist/packwiz_linux_amd64/ + + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: Linux 32-bit x86 + path: dist/packwiz_linux_386/ + + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: Linux 64-bit ARM + path: dist/packwiz_linux_arm64/ + + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: macOS 64-bit + path: dist/packwiz_darwin_amd64/ diff --git a/.gitignore b/.gitignore index a848dc3..8f45bb6 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ # I use GoLand now .idea/ + +dist/ \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..da6e074 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,30 @@ +before: + hooks: + - go mod download +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'