-
Notifications
You must be signed in to change notification settings - Fork 9
161 lines (155 loc) · 5.28 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
149
150
151
152
153
154
155
156
157
158
159
160
161
name: CI
on:
push:
tags: ['v*']
jobs:
build-linux-amd64:
name: ubuntu-18.04-gcc
runs-on: ubuntu-18.04
outputs:
installer: ${{ steps.name.outputs.artifact }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: build
run: |
cd build
make
sudo ./mkdeb.sh
sudo make install
mv -f kinx_*.deb ../
cd ..
- name: package
run: |
ref='${{ github.ref }}'
tag=$(echo $ref | perl -e "print pop @{[split '/', <>]}")
mkdir -p $tag/lib
cp ./build/utility/install.sh $tag/install.sh
cp /usr/bin/kinx $tag/kinx
cp /usr/bin/kxrepl $tag/kxrepl
cp /usr/bin/kxtest $tag/kxtest
cp -r /usr/bin/kinxlib/* $tag/lib
tar zcvf linux-amd64.tar.gz $tag/
- id: name
name: get artifact name
run: |
pathname=$(ls kinx_*.deb | head -n 1)
artifact=$(basename $pathname)
echo "::set-output name=pathname::${pathname}"
echo "::set-output name=artifact::${artifact}"
echo ${artifact}
- name: upload archive
uses: actions/upload-artifact@v1
with:
name: build-linux-amd64
path: linux-amd64.tar.gz
- name: upload installer
uses: actions/upload-artifact@v1
with:
name: ${{ steps.name.outputs.artifact }}
path: ${{ steps.name.outputs.artifact }}
build-windows-x64:
name: windows-2019-vc
runs-on: windows-2019
outputs:
installer: ${{ steps.name.outputs.artifact }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
make.cmd
- name: package
shell: pwsh
run: Compress-Archive -Path kinx.exe,kinxw.exe,kxrepl.exe,kxtest.exe,kip.exe,addpath.exe,addpathc.exe,kx.lib,*.dll,lib/ -DestinationPath windows-x64.zip -Force -Verbose
- name: create installer
uses: joncloud/makensis-action@v3.4
- id: name
name: get artifact name
shell: cmd
run: |
for /f "usebackq" %%I in (`dir /b Kinx_installer_*.exe`) do set artifact=%%I
echo %artifact%
echo ::set-output name=artifact::%artifact%
- name: upload archive
uses: actions/upload-artifact@v1
with:
name: build-windows-x64
path: windows-x64.zip
- name: upload installer
uses: actions/upload-artifact@v1
with:
name: ${{ steps.name.outputs.artifact }}
path: ${{ steps.name.outputs.artifact }}
release:
name: release
runs-on: ubuntu-latest
outputs:
release_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
upload-assets:
name: upload assets
needs:
- release
- build-linux-amd64
- build-windows-x64
runs-on: ubuntu-latest
strategy:
matrix:
job: [build-linux-amd64, build-windows-x64, build-linux-amd64-installer, build-windows-x64-installer]
include:
- job: build-linux-amd64
jobname: build-linux-amd64
download_name: build-linux-amd64
asset_path: linux-amd64.tar.gz
asset_name: package_linux-amd64.tar.gz
content_type: application/gzip
- job: build-windows-x64
jobname: build-windows-x64
download_name: build-windows-x64
asset_path: windows-x64.zip
asset_name: package_win64.zip
content_type: application/zip
- job: build-linux-amd64-installer
jobname: build-linux-amd64
download_name: ${{ needs.build-linux-amd64.outputs.installer }}
asset_path: ${{ needs.build-linux-amd64.outputs.installer }}
asset_name: ${{ needs.build-linux-amd64.outputs.installer }}
content_type: application/vnd.debian.binary-package
- job: build-windows-x64-installer
jobname: build-windows-x64
download_name: ${{ needs.build-windows-x64.outputs.installer }}
asset_path: ${{ needs.build-windows-x64.outputs.installer }}
asset_name: ${{ needs.build-windows-x64.outputs.installer }}
content_type: application/vnd.microsoft.portable-executable
steps:
- name: download archive
id: download_archive
uses: actions/download-artifact@v1
with:
name: ${{ matrix.download_name }}
path: ./
- name: display structure of downloaded files
run: ls -R
- name: upload asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.release_url }}
asset_path: ${{ matrix.asset_path }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: ${{ matrix.content_type }}