-
Notifications
You must be signed in to change notification settings - Fork 185
127 lines (105 loc) · 3.69 KB
/
workflow.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
name: build
on:
push:
branches: [ master ]
tags: [ "*" ]
paths-ignore: [ "README.md", "history.md", "release-notes.md" ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [windows-latest,ubuntu-latest,macos-latest]
# lazarus-versions: [stable, 2.2.2, 2.2.0, 2.0.12]
lazarus-versions: [stable]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: false
- name: Install Lazarus
uses: gcarreno/[email protected]
with:
with-cache: false
lazarus-version: ${{ matrix.lazarus-versions }}
- name: Build the Pascal daemon
run: lazbuild -B "src/pascalcoin_daemon.lpi"
- name: Build reference Pascal Miner
run: lazbuild -B "src/pascalcoin_miner.lpi"
- name: Build the Main Wallet Application (Windows/Linux)
if: ${{ matrix.operating-system != 'macos-latest' }}
run: lazbuild -B "src/pascalcoin_wallet_classic.lpi"
- name: Build the Main Wallet Application (macOS)
if: ${{ matrix.operating-system == 'macos-latest' }}
run: lazbuild -B --ws=cocoa "src/pascalcoin_wallet_classic.lpi"
- name: Upload binary (Windows)
if: ${{ (matrix.operating-system == 'windows-latest') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v2
with:
name: PascalCoinWindows
path: |
src/pascalcoin_daemon.exe
src/PascalCoinMiner.exe
src/PascalCoinWalletLazarus.exe
- name: Upload binary (Ubuntu)
if: ${{ (matrix.operating-system == 'ubuntu-latest') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v2
with:
name: PascalCoinLinux
path: |
src/pascalcoin_daemon
src/PascalCoinMiner
src/PascalCoinWalletLazarus
- name: Upload binary (macOS)
if: ${{ (matrix.operating-system == 'macos-latest') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v2
with:
name: PascalCoinMacOS
path: |
src/pascalcoin_daemon
src/PascalCoinMiner
src/PascalCoinWalletLazarus
package-release:
if: contains(github.ref, '/tags/')
name: Package and create GitHub Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> ${GITHUB_OUTPUT}
- name: Download the Release binary
uses: actions/download-artifact@v2
- name: List files
run: |
ls -alF PascalCoinWindows
ls -alF PascalCoinLinux
ls -alF PascalCoinMacOS
- name: Create release files
run: |
cd PascalCoinWindows
cp ../windows-dll/*.dll .
zip -r PascalCoin-${{ steps.vars.outputs.tag }}-x86_64-win64.zip *.exe *.dll
cd ../PascalCoinLinux
cp ../linux-libs/*.so.1.1 .
chmod +x PascalCoin* pascalcoin*
tar -zcvf PascalCoin-${{ steps.vars.outputs.tag }}-x86_64-linux.tar.gz PascalCoin* pascalcoin* *.so.1.1
cd ../PascalCoinMacOS
chmod +x PascalCoin* pascalcoin*
tar -zcvf PascalCoin-${{ steps.vars.outputs.tag }}-x86_64-darwin.tar.gz PascalCoin* pascalcoin*
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: PascalCoin ${{ steps.vars.outputs.tag }}
body_path: release-notes.md
files: |
PascalCoinWindows/*.zip
PascalCoinLinux/*.tar.gz
PascalCoinMacOS/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}