-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (65 loc) · 2.18 KB
/
release.yaml
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
64
65
66
67
68
69
70
---
name: Release
permissions:
actions: none
checks: none
contents: write
deployments: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
on:
release:
types:
- released
env:
SCRIPTS_NO_INTERACTIVE: "true"
defaults:
run:
shell: bash
jobs:
tag:
name: Release
runs-on: ubuntu-latest
env:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: "^1.24"
cache: true
- name: Build
run: make init
- name: GPG
id: import_gpg
if: ${{ env.gpg_private_key != '' }}
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ env.gpg_private_key }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GO_ARCHS: linux/amd64 linux/arm linux/arm64 darwin/amd64 darwin/arm64
run: |
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/main/bootstrap.sh" | bash -s -- "-c" "release.sh"
export GIT_TAG="$(basename ${{ github.ref }})"
scripts/release.sh build assets clean
- name: Docker
if: env.DOCKER_REGISTRY && env.SCW_SECRET_KEY
env:
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
DOCKER_NAMESPACE: ${{ vars.DOCKER_NAMESPACE }}
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
run: |
curl --disable --silent --show-error --location --max-time 30 "https://raw.githubusercontent.com/ViBiOh/scripts/main/bootstrap.sh" | bash -s -- "-c" "docker_promote.sh"
docker login "${DOCKER_REGISTRY}/${DOCKER_NAMESPACE}" -u nologin --password-stdin <<< "${SCW_SECRET_KEY}"
scripts/docker_promote.sh "${DOCKER_NAMESPACE}/$(make name)" "$(make version-date)" "$(basename ${{ github.ref }})"