This repository has been archived by the owner on Sep 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
138 lines (118 loc) · 4.08 KB
/
main.yaml
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
name: Build NosoWallet
on:
push:
branches: [ main ]
tags: [ "*" ]
paths-ignore: [ "README.md", "changelog.txt", "releasenotes.txt" ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build and test
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-20.04, ubuntu-latest, windows-latest]
lazarus-versions: [ stable]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
clean: true
set-safe-directory: true
- name: Install Lazarus
uses: gcarreno/[email protected]
with:
lazarus-version: ${{ matrix.lazarus-versions }}
with-cache: false
- name: Unzip packages
run: unzip -q Packages/\*.zip -d Packages
- name: Install packages
run: |
lazbuild -qqq Packages/Indy10/indylaz.lpk
lazbuild -qqq Packages/HashLib/src/Packages/FPC/HashLib4PascalPackage.lpk
lazbuild -qqq Packages/SimpleBaseLib/src/Packages/FPC/SimpleBaseLib4PascalPackage.lpk
lazbuild -qqq Packages/dcpcrypt-2.0.4.1/dcpcrypt.lpk
lazbuild -qqq Packages/CryptoLib4Pascal-master/CryptoLib/src/Packages/FPC/CryptoLib4PascalPackage.lpk
lazbuild -qqq Packages/lazbarcodes/packages/lazbarcodes_runtimeonly.lpk
lazbuild -qqq Packages/lazbarcodes/packages/lazbarcodes.lpk
- name: Build the Main App (Windows)
if: ${{ matrix.operating-system == 'windows-latest' }}
run: |
lazbuild -B --bm=Release "Noso.lpi"
- name: Build the Main App (Ubuntu)
if: ${{ matrix.operating-system == 'ubuntu-latest' }}
run: |
lazbuild -B --bm=Release "Noso.lpi"
- name: Build the Main App (Ubuntu)
if: ${{ matrix.operating-system == 'ubuntu-20.04' }}
run: |
lazbuild -B --bm=Release "Noso.lpi"
- name: Upload binary (Windows)
if: ${{ (matrix.operating-system == 'windows-latest') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v4
with:
name: noso-windows
path: Noso.exe
- name: Upload binary (Ubuntu)
if: ${{ (matrix.operating-system == 'ubuntu-latest') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v4
with:
name: noso-linuxnew
path: Noso
- name: Upload binary (Ubuntu)
if: ${{ (matrix.operating-system == 'ubuntu-20.04') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v4
with:
name: noso-linux
path: Noso
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@v3
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> ${GITHUB_OUTPUT}
- name: Download the Release binary
uses: actions/download-artifact@v4
- name: List files
run: |
ls -al
ls -al noso-windows
ls -al noso-linuxnew
ls -al noso-linux
- name: Package Windows
run: |
cp noso-windows/Noso.exe .
tag=${{ github.event.ref }}
tag=${tag#"refs/tags/"}
zip noso-${tag}-x86_64-win64.zip Noso.exe
- name: Package Ubuntu latest
run: |
cp noso-linuxnew/Noso .
tag=${{ github.event.ref }}
tag=${tag#"refs/tags/"}
chmod +x Noso
tar -zcvf noso-${tag}-x86_64-linuxnew.tgz Noso
zip -r noso-${tag}-x86_64-linuxnew.zip Noso
- name: Package Ubuntu 20.04
run: |
cp noso-linux/Noso .
tag=${{ github.event.ref }}
tag=${tag#"refs/tags/"}
chmod +x Noso
tar -zcvf noso-${tag}-x86_64-linux.tgz Noso
zip -r noso-${tag}-x86_64-linux.zip Noso
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
body_path: releasenotes.txt
files: |
noso-*.zip
noso-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}