Repository navigation
66 lines (62 loc) · 2.47 KB
/
Copy pathrelease.yaml
File metadata and controls
66 lines (62 loc) · 2.47 KB
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
name: release
on:
push:
branches:
- main
permissions:
contents: write
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache: false
# dry_run only computes the version; the release step creates the tag
# after the artifacts build, so a failed build leaves no tag behind
- name: Compute Version
id: tag_version
uses: cruxstack/gh-create-semver-tag-action@81a68a34ab1fb48f4568ddd10e76caf9a608108e # v1.0.0
with:
dry-run: true
bump-default: minor
bump-rules: bug:patch:Fixes,chore:patch:Chores,docs:patch:Documentation,test:patch:Tests,ci:patch:Development,dev:patch:Development
- name: Build Artifacts
if: steps.tag_version.outputs.tag != ''
env:
VERSION: ${{ steps.tag_version.outputs.tag }}
run: |
mkdir -p release
for arch in amd64 arm64; do
make build GOOS=linux GOARCH="$arch" VERSION="$VERSION"
tar -czf "release/github-ops-app_linux_${arch}.tar.gz" -C dist github-ops-app
make build-lambda GOARCH="$arch" VERSION="$VERSION"
(cd dist && zip -X -q "../release/github-ops-app_lambda_${arch}.zip" bootstrap)
done
(cd release && sha256sum *.tar.gz *.zip > checksums.txt)
- name: Setup Buildx
if: steps.tag_version.outputs.tag != ''
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
- name: Build Container Image
if: steps.tag_version.outputs.tag != ''
env:
VERSION: ${{ steps.tag_version.outputs.tag }}
run: docker buildx build --platform linux/amd64,linux/arm64 --build-arg VERSION="$VERSION" .
- name: Create Release
if: steps.tag_version.outputs.tag != ''
uses: cruxstack/gh-create-release-action@3a56a12ce0c6e8083dc90eb7f77805d72423b3fe # v1.0.0
with:
release-tag: ${{ steps.tag_version.outputs.tag }}
release-target: ${{ github.sha }}
release-body: ${{ steps.tag_version.outputs.changelog }}
release-if-exists: skip
release-assets: release/*