-
-
Notifications
You must be signed in to change notification settings - Fork 644
67 lines (65 loc) · 2.22 KB
/
build.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
name: build
on: [push, pull_request]
jobs:
gotify:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.22.x
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: actions/checkout@v4
- run: (cd ui && yarn)
- run: make build-js
- uses: golangci/golangci-lint-action@v5
with:
version: v1.55
args: --timeout=5m
skip-cache: true
- run: go mod download
- run: make download-tools
- run: make test
- run: make check-ci
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- if: startsWith(github.ref, 'refs/tags/v')
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- if: startsWith(github.ref, 'refs/tags/v')
run: |
export LD_FLAGS="-w -s -X main.Version=$VERSION -X main.BuildDate=$(date "+%F-%T") -X main.Commit=$(git rev-parse --verify HEAD) -X main.Mode=prod"
echo "LD_FLAGS=$LD_FLAGS" >> $GITHUB_ENV
make build
sudo chown -R $UID build
make package-zip
ls -lath build
- if: startsWith(github.ref, 'refs/tags/v')
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- if: startsWith(github.ref, 'refs/tags/v')
name: Set up QEMU
uses: docker/setup-qemu-action@v2
- if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_GHCR_USER }}
password: ${{ secrets.DOCKER_GHCR_PASS }}
- if: startsWith(github.ref, 'refs/tags/v')
run: |
make DOCKER_BUILD_PUSH=true build-docker
- if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/*.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true