summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yaml
blob: 19b0e7cb95cc01149ec35c4fc704113d4b80d6f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Release

on:
  push:
    tags:
      - "*"

permissions:
  contents: write

env:
  GO_VERSION: '1.21.4'
  PKG_NAME: 'github.com/philippta/flyscrape'
  DOCKER_IMG: ghcr.io/goreleaser/goreleaser-cross

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Fetch Git tags
        run: git fetch --force --tags

      - name: Build and Release
        run: |
          docker run \
            --rm \
            --privileged \
            -v /var/run/docker.sock:/var/run/docker.sock \
            -v $(pwd)/sysroot:/sysroot \
            -v $(pwd):/go/src/${PKG_NAME} \
            -w /go/src/${PKG_NAME} \
            -e CGO_ENABLED=1 \
            -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
            ghcr.io/goreleaser/goreleaser-cross:v${GO_VERSION} \
            release --clean