This repository was archived by the owner on Oct 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (59 loc) · 1.62 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (59 loc) · 1.62 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
57
58
59
60
61
62
63
64
65
66
name: Release
on:
push:
tags: ['v*.*.*']
jobs:
get-version:
name: Get Version
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.version.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: echo "::set-output name=VERSION::$(git describe --tags)"
id: version
release-notes:
name: Add Release Notes
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Get Release Notes
run: 'echo "$(git tag -l --format="%(contents:body)" $GITHUB_REF_NAME)" > RELEASE_NOTES'
- name: Set Release Notes
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES
release-assets:
name: Upload Release Assets
runs-on: ${{ matrix.os }}-latest
permissions:
contents: write
needs:
- get-version
- release-notes
env:
TERMAGE_VERSION: ${{ needs.get-version.outputs.VERSION }}
OUTPUT_FILENAME: termage-${{ matrix.os }}${{ matrix.os == 'windows' && '.exe' || '' }}
strategy:
matrix:
os:
- ubuntu
- windows
- macos
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: actions/checkout@v4
- name: Build
run: go build -o "${{ env.OUTPUT_FILENAME }}" -ldflags "-X main.version=${{ env.TERMAGE_VERSION }}" termage.go
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
files: ${{ env.OUTPUT_FILENAME }}