From 820ebb72acc2750c03bf7a0f5d479fb8e8cc02cb Mon Sep 17 00:00:00 2001 From: Manuel Ganter Date: Wed, 4 Feb 2026 14:46:51 +0100 Subject: [PATCH] fix(ci): use compatible action versions for Forgejo runner - Downgrade actions/setup-go from v6 to v5 (node24 not supported) - Downgrade goreleaser-action from v6 to v5 - Add CI workflow with goreleaser snapshot on push to main - Add .goreleaser.yaml configuration --- .github/workflows/ci.yaml | 32 ++++++++++++++++++++++++++ .github/workflows/release.yaml | 6 ++--- .goreleaser.yaml | 41 ++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5ba27b5 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,32 @@ +name: ci + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Lint + run: make lint + + - name: Test + run: make test + + - name: GoReleaser Check + uses: https://github.com/goreleaser/goreleaser-action@v5 + with: + args: release --snapshot --skip=publish --clean diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3040258..f6b4be6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,9 +14,9 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v5 with: - go-version: ">=1.25.1" + go-version-file: go.mod - name: Test code run: make test - name: Import GPG key @@ -26,7 +26,7 @@ jobs: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.GPG_PASSPHRASE }} - name: Run GoReleaser - uses: https://github.com/goreleaser/goreleaser-action@v6 + uses: https://github.com/goreleaser/goreleaser-action@v5 env: GITEA_TOKEN: ${{ secrets.PACKAGES_TOKEN }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..f7895f2 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,41 @@ +version: 2 + +project_name: resource-collector + +before: + hooks: + - go mod tidy + +builds: + - id: resource-collector + main: ./cmd/collector + binary: resource-collector + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + ldflags: + - -s -w + +archives: + - id: default + format: tar.gz + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + +checksum: + name_template: checksums.txt + +snapshot: + version_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + - "^chore:"