-
Notifications
You must be signed in to change notification settings - Fork 263
58 lines (50 loc) · 1.58 KB
/
create-release-draft.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
name: Create release draft
on:
workflow_dispatch:
pull_request:
types:
- closed
branches:
- 'release-*'
jobs:
create-draft:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
name: Create release draft
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version
id: version
run: |
echo version=$(cat VERSION) >> $GITHUB_OUTPUT
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build binaries
id: binaries
run: |
make release-binaries
- name: Setup qemu
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Build and possibly push image
run: |
set -ex
docker login --username "${DOCKER_USERNAME}" --password "${DOCKER_PASSWORD}" quay.io
IMAGE_PUSH=yes IMAGE_TAG=v${{ steps.version.outputs.version }} make multiarch-image
env:
DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.QUAY_TOKEN }}
- name: Create release draft
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ steps.version.outputs.version }}" \
--title "v${{ steps.version.outputs.version }}" \
--target "${{ github.base_ref }}" \
--draft \
dist/release/*