forked from tailwarden/komiser
-
Notifications
You must be signed in to change notification settings - Fork 2
113 lines (95 loc) · 3.03 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
106
107
108
109
110
111
112
113
name: "Release Komiser"
on:
push:
# run only against tags
tags:
- "*"
permissions: write-all
jobs:
build_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
cache-dependency-path: "dashboard/package-lock.json"
- run: npm ci
working-directory: dashboard
- run: npm run build
working-directory: dashboard
- uses: actions/upload-artifact@v3
with:
name: dashboard-build
path: dashboard/out
build_komiser:
runs-on: ubuntu-latest
needs: build_frontend
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.2"
cache: true
- name: Install go-bin-data
run: |
go install -a -v github.com/go-bindata/go-bindata/...@latest
go install -v github.com/elazarl/go-bindata-assetfs/...
- uses: actions/download-artifact@v3
with:
name: dashboard-build
path: out
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_LOGIN }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
PURPLIN_BOT: ${{ secrets.PURPLIN_BOT }}
DISCORD_FEEDBACK_URL: ${{ secrets.DISCORD_FEEDBACK_URL }}
- uses: actions/checkout@v3
with:
repository: tailwarden/helm
ref: master
path: helm
token: ${{ secrets.PURPLIN_BOT }}
persist-credentials: true
- name: "Create new values.yaml"
id: release-version
run: |
export VERSION=$(echo $TAG | cut -c2-)
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_OUTPUT
cat templates/values.template.yaml | envsubst > helm/values.yaml
env:
TAG: ${{ github.ref_name }}
- name: "Push changes to tailwarden/helm"
run: |
cd ./helm
git add .
git config user.name "purplin"
git config user.email "[email protected]"
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit"
exit 0
fi
git commit -m "chore: bump version to ${VERSION}"
git push
env:
VERSION: ${{ steps.release-version.outputs.RELEASE_VERSION }}