-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (43 loc) · 1.42 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
# Copied and modified from k0sctl: https://github.com/k0sproject/k0sctl/blob/main/.github/workflows/release.yaml
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
name: release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
# Ugly hack to get the tag name
# github.ref gives the full reference like refs.tags.v0.0.1-beta1
- name: Branch name
id: branch_name
run: |
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> ${GITHUB_OUTPUT}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
check-latest: true
- name: Build binaries
env:
TAG_NAME: ${{ steps.branch_name.outputs.TAG_NAME }}
run: |
./scripts/build.sh
./scripts/checksums.sh
- name: Create release and upload binaries
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/*
body_path: bin/checksums.md
tag_name: ${{ steps.branch_name.outputs.TAG_NAME }}
name: ${{ steps.branch_name.outputs.TAG_NAME }}
draft: true # So we can manually edit before publishing
prerelease: ${{ contains(steps.branch_name.outputs.TAG_NAME, '-') }} # v0.1.2-beta1, 1.2.3-rc1