-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (56 loc) · 1.72 KB
/
publish.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
---
name: publish
on:
push:
tags:
- v*
jobs:
github:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Import GPG key
id: gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup Go
uses: ./.github/actions/setup-go
- name: Release
uses: goreleaser/goreleaser-action@v3
with:
args: release --timeout=60m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.gpg.outputs.fingerprint }}
registry:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get version
uses: actions/github-script@v6
id: version
with:
result-encoding: string
script: return context.ref.split('/')[2].substring(1)
- name: Setup Docker
uses: ./.github/actions/setup-docker
with:
registry_domain: ghcr.io
registry_username: ${{ secrets.GH_USER }}
registry_password: ${{ secrets.GH_TOKEN }}
- name: Build and push ${{ github.repository }}:${{ steps.version.outputs.result }}
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository }}:${{ steps.version.outputs.result }}