This repository was archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (45 loc) · 1.39 KB
/
release.yaml
File metadata and controls
56 lines (45 loc) · 1.39 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
name: Create release
on:
workflow_dispatch:
inputs:
version:
description: 'Name of the release'
required: true
permissions:
contents: write
env:
GO_VERSION: '1.19'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/checkout@v3
- id: commit
uses: pr-mpt/actions-commit-hash@v2
with:
commit: "${{ github.sha }}"
- name: Cache build dependencies
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/_go.sum') }}
- name: Build
if: ${{ github.event_name == 'workflow_dispatch' }}
run: go build -ldflags="-X main.Version=${{ steps.commit.outputs.short }}" -o bin/helpwave -v
- uses: actions/upload-artifact@v3
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
name: helpwave
path: bin/helpwave
- name: Create release
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
files: |
bin/helpwave
tag_name: ${{ github.event.inputs.version }}