This repository was archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
105 lines (86 loc) · 2.33 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Release
on:
push:
tags:
- "v*"
jobs:
prepare:
name: Prepare
runs-on: ubuntu-22.04
outputs:
tag: ${{ steps.get_version.outputs.tag }}
version: ${{ steps.get_version.outputs.version }}
steps:
- name: printenv
run: |
printenv | sort
- name: Checkout code
uses: actions/checkout@v3
- name: Get version
id: get_version
run: |
TAG="${GITHUB_REF#refs/tags/}"
echo "tag=${TAG}" >>"${GITHUB_OUTPUT}"
echo "version=${TAG#v}" >>"${GITHUB_OUTPUT}"
release:
name: Release
needs:
- prepare
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ needs.prepare.outputs.tag }}
- name: Install docker-setup
uses: uniget-org/uniget-action@main
with:
prefix: helper
tools: go goreleaser syft
log-level: debug
plan: true
- name: Build and release binaries
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
run: |
helper/usr/local/bin/goreleaser release --skip-sbom
build:
name: Build
needs:
- prepare
- release
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: nicholasdille
password: ${{ secrets.PACKAGES_TOKEN }}
- name: Install docker-setup
uses: uniget-org/uniget-action@main
with:
prefix: helper
tools: gojq regclient yq
log-level: trace
plan: true
- name: Update manifest
run: |
VERSION=${{ needs.prepare.outputs.version }} \
helper/usr/local/bin/yq eval --inplace '.version = env(VERSION)' tools/docker-setup/manifest.yaml
- name: Build and push
run: |
make docker-setup--push metadata.json--push
- name: Commit updated manifest
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
create_branch: false
file_pattern: tools/docker-setup/manifest.yaml
commit_message: "Version bump for docker-setup"