-
-
Notifications
You must be signed in to change notification settings - Fork 72
116 lines (100 loc) · 2.88 KB
/
ci.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI
on: [ push, pull_request ]
jobs:
lint-source-code:
name: Lint Source Code
runs-on: macos-latest # use macOS to avoid installation of desktop deps
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: go.mod
architecture: x64
cache: false
- name: Lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.52.2
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
include:
- os: ubuntu-latest
rust-target: 1.79-x86_64-unknown-linux-gnu
- os: windows-latest
rust-target: 1.79-x86_64-pc-windows-gnu
- os: macos-latest
rust-target: 1.79-x86_64-apple-darwin
runs-on: ${{ matrix.os }}
name: Build - ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- if: contains(matrix.os, 'ubuntu')
name: Dependencies (Linux)
run: |
sudo apt clean
sudo apt update
sudo apt install xorg-dev libgtk-3-dev
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: go.mod
architecture: x64
cache: true
- name: Setup Rust
run: |
rustup install ${{ matrix.rust-target }}
rustup default ${{ matrix.rust-target }}
- name: Setup Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
workspaces: third_party/sdmmparser/src
- if: contains(matrix.os, 'windows')
name: Pre Build (Windows)
run: task task_win:gen_syso
- name: Build
run: task build
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}
path: dst/*
if-no-files-found: error
release:
name: Release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v') # if tag starts with "v"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download Release Files
uses: actions/download-artifact@v4
with:
path: dst/
- name: Prepare Release Files
run: task release-files
- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
files: |
dst/bin/**
dst/archive/**