-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (45 loc) · 1.35 KB
/
release.yml
File metadata and controls
57 lines (45 loc) · 1.35 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
name: Release
on:
push:
tags:
- 'v*.*.*'
env:
ARCH: |
amd64
arm64
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# NB: actions/checkout quietly fetches all tags as lightweight tags,
# even if they’re annotated upstream. That, of course, prevents use
# of the tag message as release notes. This works around that.
#
# See https://github.com/actions/checkout/issues/290 for details.
- name: Fetch tags
run: git fetch --tags --force
- name: Set up Go
uses: actions/setup-go@v4
- name: Build
run: |
set -o errexit
REPO_NAME=${GITHUB_REPOSITORY#${GITHUB_REPOSITORY_OWNER}/}
TAG_NAME=$(git describe --exact-match)
git tag --list --format='%(contents)' "$TAG_NAME" > RELEASE-NOTES
for cur_arch in $ARCH; do
docker build . --platform linux/$cur_arch -t $REPO_NAME
docker save $REPO_NAME -o "$REPO_NAME-$TAG_NAME-$cur_arch.tar"
done
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: RELEASE-NOTES
files: "*.tar"