-
Notifications
You must be signed in to change notification settings - Fork 3
148 lines (140 loc) · 3.92 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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: main
on:
push:
tags:
- 'v*'
env:
APP_NAME: 'pax'
NIM_VERSION: '1.6.4'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Nim
uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ env.NIM_VERSION }}
- name: Install
run: nimble install -y
- name: Test
run: nimble test
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Nim
uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ env.NIM_VERSION }}
- name: Build
run: nimble build -d:release -y
- name: Rename macOS binary
if: matrix.os == 'macos-latest'
run: mv ${{ env.APP_NAME }} ${{ env.APP_NAME }}-macos
- name: Store artifacts
uses: actions/upload-artifact@v2
with:
name: binary-${{ matrix.os }}
path: |
${{ env.APP_NAME }}
${{ env.APP_NAME }}.exe
${{ env.APP_NAME }}-macos
dll:
runs-on: ubuntu-latest
steps:
- name: Download DLLs
uses: wei/curl@master
with:
args: https://nim-lang.org/download/dlls.zip --output dlls.zip
- name: Unzip
uses: montudor/action-zip@v1
with:
args: unzip -qq dlls.zip
- name: Store DLLs artifacts
uses: actions/upload-artifact@v2
with:
name: dlls
path: |
cacert.pem
libcrypto-1_1.dll
libcrypto-1_1-x64.dll
libssl-1_1.dll
libssl-1_1-x64.dll
package-windows:
runs-on: ubuntu-latest
needs: [build, dll]
steps:
- name: Download Windows artifact
uses: actions/download-artifact@v2
with:
name: binary-windows-latest
- name: Download DLLs artifacts
uses: actions/download-artifact@v2
with:
name: dlls
- name: Zip binary + dlls
uses: montudor/action-zip@v1
with:
args: zip -qq -r ${{ env.APP_NAME }}-windows.zip .
- name: Store windows zip artifact
uses: actions/upload-artifact@v2
with:
name: package-windows-latest
path: ${{ env.APP_NAME }}-windows.zip
changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Write changelog to file
run: echo '${{ steps.changelog.outputs.changelog }}' > changelog.txt
- name: Store changelog
uses: actions/upload-artifact@v2
with:
name: changelog
path: changelog.txt
release:
runs-on: ubuntu-latest
needs: [build, changelog, package-windows]
steps:
- name: Download Windows package artifact
uses: actions/download-artifact@v2
with:
name: package-windows-latest
- name: Download Linux binary artifact
uses: actions/download-artifact@v2
with:
name: binary-ubuntu-latest
- name: Download macOS binary artifact
uses: actions/download-artifact@v2
with:
name: binary-macos-latest
- name: Download changelog
uses: actions/download-artifact@v2
with:
name: changelog
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog.txt
files: |
${{ env.APP_NAME }}
${{ env.APP_NAME }}-windows.zip
${{ env.APP_NAME }}-macos
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}