-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (77 loc) · 2.66 KB
/
build.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
name: build
on:
push:
branches: [ main ]
tags: [ "*" ]
paths-ignore: [ "README.md", "history.md", "release-notes.md" ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build and/or Test
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, windows-latest ]
lazarus-versions: [ stable, 2.0.12, 2.0.10 ]
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install Lazarus
uses: gcarreno/setup-lazarus@v3.0.16
with:
lazarus-version: ${{ matrix.lazarus-versions }}
include-packages: "HtmlViewer"
- name: Build the Main App (Windows)
if: ${{ matrix.operating-system == 'windows-latest' }}
run: lazbuild -B --bm=Release "src/TestMarkdown.lpi"
- name: Build the Main App (Ubuntu)
if: ${{ matrix.operating-system == 'ubuntu-latest' }}
run: lazbuild -B --bm=Release "src/TestMarkdown.lpi"
- name: Build the Main App (macOS)
if: ${{ matrix.operating-system == 'macos-latest' }}
run: lazbuild -B --bm=Release --ws=cocoa "src/TestMarkdown.lpi"
- name: Upload binary (Windows)
if: ${{ (matrix.operating-system == 'windows-latest') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v2
with:
name: TestMarkdown
path: bin/TestMarkdown.exe
- name: Upload binary (Ubuntu)
if: ${{ (matrix.operating-system == 'ubuntu-latest') && (matrix.lazarus-versions == 'stable') }}
uses: actions/upload-artifact@v2
with:
name: TestMarkdown
path: bin/TestMarkdown
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 ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Download the Release binary
uses: actions/download-artifact@v2
- name: List files
run: ls -alF TestMarkdown
- name: Create release files
run: |
cd TestMarkdown
zip -r TestMarkdown-${{ steps.vars.outputs.tag }}-x86_64-win64.zip TestMarkdown.exe
tar -zcvf TestMarkdown-${{ steps.vars.outputs.tag }}-x86_64-linux.tar.gz TestMarkdown
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: TestMarkdown ${{ steps.vars.outputs.tag }}
body_path: release-notes.md
files: |
TestMarkdown/*.tar.gz
TestMarkdown/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}