-
Notifications
You must be signed in to change notification settings - Fork 9
107 lines (90 loc) · 3.6 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
---
name: release
on:
release:
types:
- created
jobs:
lint:
uses: ./.github/workflows/lint.yaml
test:
uses: ./.github/workflows/test.yaml
release:
needs:
- lint
- test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: load env vars for workflow run
run: |
source .github/vars.env
echo "GO_VERSION=$GO_VERSION" >> "$GITHUB_ENV"
echo "DEVSPACE_VERSION=$DEVSPACE_VERSION" >> "$GITHUB_ENV"
echo "GCI_VERSION=$GCI_VERSION" >> "$GITHUB_ENV"
echo "GOFUMPT_VERSION=$GOFUMPT_VERSION" >> "$GITHUB_ENV"
echo "GOLANGCI_LINT_VERSION=$GOLANGCI_LINT_VERSION" >> "$GITHUB_ENV"
echo "GOLINES_VERSION=$GOLINES_VERSION" >> "$GITHUB_ENV"
echo "GOTESTSUM_VERSION=$GOTESTSUM_VERSION" >> "$GITHUB_ENV"
echo "HELM_VERSION=$HELM_VERSION" >> "$GITHUB_ENV"
echo "GORELEASER_VERSION=$GORELEASER_VERSION" >> "$GITHUB_ENV"
- name: install devspace
run: |
curl -L -o devspace \
"https://github.com/loft-sh/devspace/releases/download/${{ env.DEVSPACE_VERSION}}/devspace-linux-amd64" &&
install -c -m 0755 devspace /usr/local/bin
working-directory: /tmp
- name: install helm
run: |
curl -L -o helm.tar.gz \
"https://get.helm.sh/helm-${{ env.HELM_VERSION}}-linux-amd64.tar.gz"
tar -zxvf helm.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
working-directory: /tmp
- name: login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# note: we run goreleaser before any helm packaging since helm updates the chart.yaml files
# w/ the release tag/version which upsets goreleaser (and we dont want to .gitignore the chart
# manifest obviously)
- name: run goreleaser to build clabverter/checksums
uses: goreleaser/goreleaser-action@v5
with:
version: ${{ env.GORELEASER_VERSION }}
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# simply use gh cli to upload since we dont actually want an action that makes the release
# for us, just wanna upload assets
- name: upload clabverter binaries (and checksums) to the release
run: |
cd .dist
gh release upload ${{ github.ref_name }} checksums.txt
for filename in *.tar.gz; do
[ -e "$filename" ] || continue
gh release upload ${{ github.ref_name }} "$filename"
done
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
- name: build and push images
run: |
RELEASE_TAG=${{ github.ref_name }}
RELEASE_VERSION=${RELEASE_TAG#v}
devspace run build --profile release --var RELEASE_VERSION=$RELEASE_VERSION
- name: package and push charts
run: |
RELEASE_TAG=${{ github.ref_name }}
RELEASE_VERSION=${RELEASE_TAG#v}
helm registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
make set-chart-versions $RELEASE_VERSION
helm package charts/clicker --version $RELEASE_VERSION
helm push clicker-$RELEASE_VERSION.tgz oci://ghcr.io/srl-labs/clabernetes
helm package charts/clabernetes --version $RELEASE_VERSION
helm push clabernetes-$RELEASE_VERSION.tgz oci://ghcr.io/srl-labs/clabernetes