-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (56 loc) · 1.63 KB
/
main.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
name: main
on:
push:
branches:
- master
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build:
name: Build, test and draft release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install golang
uses: actions/setup-go@v5
with:
go-version: '1.20.5'
- name: Run unit tests
run: go test -v ./...
- name: Install dependencies
run: .github/workflows/helpers/install-deps.sh
- name: Build web
run: ./web/app/make.sh all
- name: Build binaries
run: .github/workflows/helpers/build-bin.sh build/ all
- name: Run integration tests
run: .github/workflows/helpers/run-tests.sh build/notesium-linux-amd64
- name: Print version
run: build/notesium-linux-amd64 version --verbose
- name: Generate release notes
run: .github/workflows/helpers/release-notes.sh ${{ github.ref }} > build/release-notes.md
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: build/
- name: Create draft release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
fail_on_unmatched_files: true
body_path: build/release-notes.md
files: |
build/checksums.txt
build/notesium-linux-amd64
build/notesium-darwin-amd64
build/notesium-windows-amd64.exe