-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (70 loc) · 2.21 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
# .github/workflows/release.yml
name: Release
on:
workflow_dispatch:
push:
tags:
- "v*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: zeiss/typhoon
REGISTRY: ghcr.io
jobs:
test:
permissions:
checks: write
uses: ./.github/workflows/main.yml
release:
needs: [test]
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v4
- run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ github.job }}-${{ runner.os }}-go-
- id: image-tag
run: |
IMAGE_TAG=${GITHUB_SHA}
[[ ${GITHUB_REF_TYPE} == "tag" ]] && IMAGE_TAG=${GITHUB_REF_NAME}
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- run: sudo apt-get update && sudo apt install -y libxml2-dev libxslt1-dev liblzma-dev zlib1g-dev
- run: |
IMAGE_TAG=${{ steps.image-tag.outputs.IMAGE_TAG }} make release
env:
KO_DOCKER_REPO: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
DIST_DIR: /tmp/dist
if: success()
- run: |
go run internal/tools/updater/main.go --file charts/typhoon/Chart.yaml --version ${{ env.RELEASE_VERSION }}
- uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
charts_dir: charts
config: ${{ github.workspace }}/.cr.yml
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: manifests
path: /tmp/dist
retention-days: 14