-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (42 loc) · 1.29 KB
/
release.yml
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
name: release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
name: Create draft release
runs-on: ubuntu-latest
environment: default
steps:
- name: Set environment variables
run: |
echo "IMAGE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
if [ "${{ secrets.REGISTRY }}" != "" ]; then
echo "REGISTRY=${{ secrets.REGISTRY }}" >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v3
- name: Calculate go version
run: echo "go_version=$(make go-version)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.go_version }}
- name: Login docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Generate release
run: make release
- name: Generate draft release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ env.TAG }}
name: Release ${{ env.TAG }}
files: out/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}