-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (84 loc) · 2.72 KB
/
c-cpp.yml
File metadata and controls
87 lines (84 loc) · 2.72 KB
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
name: Build
on: [push]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
# Build Artifact
- uses: actions/checkout@master
- name: configure
run: cmake . -DCMAKE_BUILD_TYPE=RELEASE
- if: startsWith(matrix.os,'ubuntu') || startsWith(matrix.os,'macOS')
name: make
run: make
- if: startsWith(matrix.os,'windows')
name: make
run: cmake --build . --target ALL_BUILD --config Release -- /nologo /verbosity:minimal /maxcpucount
# Rename Artifact
- if: startsWith(matrix.os,'ubuntu')
name: Rename binary
run: mv bin/PassCoder2 bin/PassCoder2-linux-x64
- if: startsWith(matrix.os, 'macOS')
name: Rename binary
run: mv bin/PassCoder2 bin/PassCoder2-macos-x64
- if: startsWith(matrix.os, 'windows')
name: Rename binary
run: mv bin/Release/PassCoder2.exe bin/Release/PassCoder2-windows-x64.exe
# Uploading Artifact
- if: startsWith(matrix.os,'ubuntu')
name: Upload binary
uses: actions/upload-artifact@v2
with:
name: PassCoder2-linux-x64
path: bin/PassCoder2-linux-x64
- if: startsWith(matrix.os, 'macOS')
name: Upload binary
uses: actions/upload-artifact@v2
with:
name: PassCoder2-macos-x64
path: bin/PassCoder2-macos-x64
- if: startsWith(matrix.os, 'windows')
name: Upload binary
uses: actions/upload-artifact@v2
with:
name: PassCoder2-windows-x64
path: bin/Release/PassCoder2-windows-x64.exe
release-upload:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
name: Upload artifact to Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
name: Download Artifact Windows
with:
name: PassCoder2-windows-x64
path: PassCoder2-windows-x64
- uses: actions/download-artifact@master
name: Download Artifact Linux
with:
name: PassCoder2-linux-x64
path: PassCoder2-linux-x64
- uses: actions/download-artifact@master
name: Download Artifact MacOS
with:
name: PassCoder2-macos-x64
path: PassCoder2-macos-x64
- name: Create release
uses: Roang-zero1/github-create-release-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release
uses: Roang-zero1/github-upload-release-artifacts-action@master
with:
args:
PassCoder2-windows-x64
PassCoder2-linux-x64
PassCoder2-macos-x64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}