From e64fff9e99db56e2d47acdb379f34e942cd573f9 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Wed, 11 Mar 2026 21:53:35 +0000 Subject: [PATCH] ci: add CI workflow (tests, goimports, staticcheck, build) and fix release auth --- .github/workflows/ci.yaml | 12 ++++++++++++ .github/workflows/release.yaml | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6419b81..8be37d0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,6 +9,9 @@ on: permissions: contents: read +env: + GOPRIVATE: github.com/taigrr/* + jobs: lint: runs-on: ubuntu-latest @@ -19,6 +22,9 @@ jobs: with: go-version-file: go.mod + - name: Configure private modules + run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/" + - name: Check goimports run: | go install golang.org/x/tools/cmd/goimports@latest @@ -38,6 +44,9 @@ jobs: with: go-version-file: go.mod + - name: Configure private modules + run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/" + - name: Run tests run: go test -race -v ./... @@ -50,5 +59,8 @@ jobs: with: go-version-file: go.mod + - name: Configure private modules + run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/" + - name: Build run: go build -v ./... diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c440d49..8e7775f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,6 +8,9 @@ on: permissions: contents: write +env: + GOPRIVATE: github.com/taigrr/* + jobs: release: runs-on: ubuntu-latest @@ -21,8 +24,7 @@ jobs: go-version-file: go.mod - name: Configure private modules - run: git config --global url."https://${{ secrets.GO_MODULE_PAT }}@github.com/".insteadOf "https://github.com/" - if: ${{ secrets.GO_MODULE_PAT != '' }} + run: git config --global url."https://${{ secrets.GH_PAT }}@github.com/".insteadOf "https://github.com/" - uses: goreleaser/goreleaser-action@v6 with: