-
Notifications
You must be signed in to change notification settings - Fork 61
111 lines (99 loc) · 3.16 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
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
106
107
108
109
110
111
name: Create release
on:
push:
tags:
- "v*"
env:
GH_TAG: ${{github.ref_name}}
permissions:
contents: write
packages: write
jobs:
# # # # # # # # # # # # # # # # #
# Binaries & GH Releases
# # # # # # # # # # # # # # # # #
build-release-binaries:
name: Build Relase Binaries
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v4
# Build the binaries using the `build/artifacts.sh` script in the repo
- name: Build Artifacts
run: build/artifacts.sh $GH_TAG
# https://github.com/marketplace/actions/upload-a-build-artifact
- uses: actions/upload-artifact@v4
with:
name: binaries
path: bin/artifacts/
release:
name: Release
runs-on: ubuntu-latest
needs: [build-release-binaries]
steps:
- uses: actions/checkout@v4
# https://github.com/actions/download-artifact
- uses: actions/download-artifact@v4
with:
name: binaries
path: bin/artifacts/
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: build/release.sh $GH_TAG
# # # # # # # # # # # # # # # # #
# Update Helm Chart
# # # # # # # # # # # # # # # # #
update-helm-chart-version:
name: Update Helm Chart Version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update Chart
# https://github.com/marketplace/actions/github-push
run: |
CAPTURE_GROUP="appVersion:\ \"v[0-9]\+\.[0-9]\+\.[0-9]\+\""
REPLACEMENT="appVersion\:\ \"$GH_TAG\""
echo "Updating Piko Helm Chart to Version $GH_TAG"
sed -i'' "s/$CAPTURE_GROUP/$REPLACEMENT/" $GITHUB_WORKSPACE/operations/helm/piko/Chart.yaml
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -am "[bot] bump helm chart to version $GH_TAG"
git push origin HEAD:main
# # # # # # # # # # # # # # # # #
# Build & Publish Containers
# # # # # # # # # # # # # # # # #
docker-containers:
name: Build & Publish Containers
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Docker Tags
# https://github.com/docker/metadata-action
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{github.actor}}/piko
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
build-args: version=$GH_TAG
file: build/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}