-
Notifications
You must be signed in to change notification settings - Fork 15
79 lines (66 loc) · 2.04 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
name: Release
on:
push:
tags:
- "v*"
env:
GO_VERSION: 1.23
permissions:
contents: write
packages: write
jobs:
goreleaser:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Get ldflags env values
run: |
echo "BUILD_TIMESTAMP=$(date +'%s')" >> $GITHUB_ENV
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
echo "COMMIT_HASH=${{ github.sha }}" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
version:
runs-on: ubuntu-latest
environment: production
env:
CHART_PATH: ./deploy/charts/burrito
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Bump VERSION file
run: |
echo ${{ github.ref_name }} > VERSION
- name: Bump Helm Chart versions
run: |
export CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g')
export APP_VERSION=${{ github.ref_name }}
yq -i '.version = env(CHART_VERSION)' $CHART_PATH/Chart.yaml
yq -i '.appVersion = env(APP_VERSION)' $CHART_PATH/Chart.yaml
- name: Commit version to repository
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(release): bump version to ${{ github.ref_name }}"
push_options: --force
build-and-push:
uses: ./.github/workflows/build-and-push.yaml