-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (73 loc) · 2.37 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
on: workflow_dispatch # manual trigger
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ^1.18
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -covermode=atomic ./...
tag:
name: Tag
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set GitHub Actions as commit author
shell: bash
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Set up Semantic Versioning
run: |
curl -s https://api.github.com/repos/bvieira/sv4git/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux")) | .browser_download_url' | wget -O /tmp/sv4git.tar.gz -qi - \
&& tar -C /usr/local/bin -xzf /tmp/sv4git.tar.gz
- name: Push a new tag
id: push-new-tag
run: |
git sv tag
VERSION=$(git sv cv)
echo "::set-output name=tag::v$VERSION"
outputs:
tag: ${{ steps.push-new-tag.outputs.tag }}
release:
name: Release
runs-on: ubuntu-latest
needs: [tag]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Semantic Versioning
run: |
curl -s https://api.github.com/repos/bvieira/sv4git/releases/latest | jq -r '.assets[] | select(.browser_download_url | contains("linux")) | .browser_download_url' | wget -O /tmp/sv4git.tar.gz -qi - \
&& tar -C /usr/local/bin -xzf /tmp/sv4git.tar.gz
- name: Set up Go
id: go
uses: actions/setup-go@v2
with:
go-version: ^1.18
- name: Create release notes
run: |
git tag -l
git sv rn -t "${{ needs.tag.outputs.tag }}" > release-notes.md
- name: Install Task
uses: arduino/setup-task@v1
- name: Build releases
run: task build-all
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: release-notes.md
tag_name: ${{ needs.tag.outputs.tag }}
fail_on_unmatched_files: true
files: |
bin/dokimi_*