diff --git a/.github/workflows/test-release.yml b/.github/workflows/test-release.yml new file mode 100644 index 0000000000..bdf2f12151 --- /dev/null +++ b/.github/workflows/test-release.yml @@ -0,0 +1,25 @@ +name: Test Release +on: + push: + tags: + - 'test-release*' # Only triggers on tags starting with 'test-release' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Fetch All Tags + run: git fetch --force --tags + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: '1.18.1' + - name: Run GoReleaser (Skip Publishing) + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist --skip-publish # Test the build without creating a release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000000..5b64d44d41 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,36 @@ +before: + hooks: + - go mod tidy + +builds: + - dir: cmd + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + files: + - LICENSE + - README.md + +checksum: + name_template: 'checksums.txt' + +snapshot: + name_template: "{{ .Tag }}-SNAPSHOT" + +release: + draft: true # Create releases as drafts to avoid cluttering public release history + prerelease: true # Mark the releases as pre-releases (useful for distinguishing test releases) + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'