-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (41 loc) · 1.46 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
name: release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Release
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup golang
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Build binaries
run: make install GOBIN=`pwd`/docker
- name: Build setup-hw image
run: |
docker build -t quay.io/cybozu/setup-hw:latest --target stage1 docker
docker build -t quay.io/cybozu/setup-hw-secret:latest docker
- name: Push images
run: |
echo ${{ secrets.QUAY_PASSWORD }} | docker login -u ${{ secrets.QUAY_USER }} --password-stdin quay.io
tag=${GITHUB_REF#refs/tags/v}
for name in setup-hw setup-hw-secret; do
echo "pushing ${name}:v${tag} ..."
docker tag quay.io/cybozu/${name}:latest quay.io/cybozu/${name}:$tag
if ! echo $tag | grep -q -e '-'; then docker push quay.io/cybozu/${name}:latest; fi
docker push quay.io/cybozu/${name}:$tag
done
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tagname="${GITHUB_REF#refs/tags/}"
if echo ${{ github.ref }} | grep -q -e '-'; then prerelease=-p; fi
gh release create -t "Release $tagname" $prerelease \
-n "See [CHANGELOG.md](./CHANGELOG.md) for details." \
"$tagname"