diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..b6e4744 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,45 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +permissions: + contents: write + packages: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + + # We need buildx so we can do multi-arch Docker builds with goreleaser + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # Goreleaser's auto-login doesn't work as expected, so we work around it + # by manually logging in using the actions provided GITHUB_TOKEN. + - uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Go + uses: actions/setup-go@v5 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: '~> v2' + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 018984d..1402678 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,3 +1,5 @@ +version: 2 + project_name: base16-builder-go builds: - env: