Skip to content

Commit f9ac027

Browse files
committed
add build.yml
1 parent 3558c5c commit f9ac027

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/build.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths-ignore:
7+
- 'doc/**'
8+
- 'README*'
9+
workflow_dispatch:
10+
11+
12+
env:
13+
NFCTOOLSGUI_COMPILER: "Github Action"
14+
15+
jobs:
16+
build:
17+
if: ${{ always() }}
18+
name: Build (${{ matrix.os }})
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: [ macOS-latest, ubuntu-latest, windows-latest, macOS(ARM64) ]
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
submodules: 'recursive'
28+
29+
- name: install dependencies(macOS)
30+
if: runner.os == 'macOS'
31+
run: brew install autoconf automake libtool pkg-config
32+
33+
- name: install dependencies(ubuntu)
34+
if: runner.os == 'Linux'
35+
run: sudo apt-get install liblzma-dev libreadline-dev
36+
37+
- name: Compile core files(Unix)
38+
if: runner.os != 'Windows'
39+
run: sh ./compile.sh
40+
41+
- if: runner.os == 'Windows'
42+
uses: msys2/setup-msys2@v2
43+
- name: Compile core files(Windows)
44+
if: runner.os == 'Windows'
45+
run: C:\msys64\msys2_shell.cmd -mingw64 -defterm -here -no-start -c ./compile.sh
46+
47+
- name: Use Node.js
48+
uses: actions/setup-node@v3
49+
with:
50+
node-version: '18.x'
51+
cache: 'npm'
52+
- name: Install dependencies
53+
run: npm ci
54+
- name: Compile GUI
55+
run: npm run make
56+
57+
- name: Upload release
58+
uses: actions/upload-artifact@v3
59+
with:
60+
name: NFCToolsGUI-${{ runner.os }}-${{ runner.arch }}
61+
path: "out/make/zip/*/*/*.zip"

0 commit comments

Comments
 (0)