goreleaser.yml

 1name: goreleaser
 2
 3on:
 4  push:
 5    tags:
 6      - "v*.*.*"
 7
 8permissions:
 9  contents: write
10  packages: write
11
12jobs:
13  goreleaser:
14    runs-on: ubuntu-latest
15    env:
16      DOCKER_CLI_EXPERIMENTAL: enabled
17    steps:
18      - name: Checkout
19        uses: actions/checkout@v2
20        with:
21          fetch-depth: 0
22
23      - name: Set up Go
24        uses: actions/setup-go@v2
25        with:
26          go-version: 1.17
27
28      - name: Login to DockerHub
29        uses: docker/login-action@v1
30        with:
31          username: ${{ secrets.DOCKERHUB_USERNAME }}
32          password: ${{ secrets.DOCKERHUB_TOKEN }}
33
34      - name: Login to GitHub Container Registry
35        uses: docker/login-action@v1
36        with:
37          registry: ghcr.io
38          username: ${{ github.repository_owner }}
39          password: ${{ secrets.GITHUB_TOKEN }}
40
41      - name: Set up QEMU
42        uses: docker/setup-qemu-action@v1
43
44      - name: Set up Docker Buildx
45        id: buildx
46        uses: docker/setup-buildx-action@v1
47
48      - name: Run GoReleaser
49        uses: goreleaser/goreleaser-action@v2
50        with:
51          distribution: goreleaser
52          version: latest
53          args: release --rm-dist --skip-sign
54        env:
55          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56          HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}