diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..06a9834 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,49 @@ +# .github/workflows/release.yml +name: goreleaser + +on: + pull_request: + push: + # run only against tags + tags: + - "*" + +permissions: + contents: write + issues: write + +jobs: + goreleaser: + runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + # More assembly might be required: Docker logins, GPG, etc. + # It all depends on your needs. + - name: build + run: make build + - name: golangci-lint + run: make lint + - name: format + run: | + make format + if [ -z "$(git status --untracked-files=no --porcelain)" ]; then + echo "All files formatted" + else + echo "Running format is required" + exit 1 + fi + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file