go-gremlins/gremlins

View on GitHub
.github/workflows/release.yml

Summary

Maintainability
Test Coverage
name: release
on:
  push:
    tags: [ 'v*' ]

permissions:
  contents: write
  packages: write

jobs:
  goreleaser:
    runs-on: ubuntu-latest
    env:
      DOCKER_CLI_EXPERIMENTAL: "enabled"
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Fetch all tags
        run: git fetch --force --tags
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Docker Login
        uses: docker/login-action@v1
        with:
          registry: docker.io
          username: gogremlins
          password: ${{ secrets.DOCKER_HUB_TOKEN }}
      - name: Set up Go
        uses: actions/setup-go@v4
        with:
          go-version-file: 'go.mod'
      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v5
        with:
          distribution: goreleaser
          version: latest
          args: release --rm-dist
        env:
          GITHUB_TOKEN: ${{ secrets.WORKFLOW_PAT }}
  documentation:
    name: Build documentation
    if: ${{ github.event_name != 'pull_request' }}
    needs: goreleaser
    uses: ./.github/workflows/docs.yml
    with:
      version: ${{ github.ref }}