-
-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (53 loc) · 1.46 KB
/
release.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release 🚀
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
packages: write
attestations: write
id-token: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker_push:
name: Docker Build & Push
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set env
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "NOW=$(date --utc +%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
- name: Build & push Docker image to ghcr.io
uses: mr-smithers-excellent/docker-build-push@v6
with:
image: git-sync
tags: ${{ env.RELEASE_VERSION }},latest
registry: ghcr.io
multiPlatform: true
platform: linux/amd64,linux/arm64,linux/arm/v7
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
buildArgs: 'VERSION=${{ env.RELEASE_VERSION }},BUILD=${{ env.NOW }}'