-
Notifications
You must be signed in to change notification settings - Fork 23
123 lines (119 loc) · 4.07 KB
/
Copy pathci.yml
File metadata and controls
123 lines (119 loc) · 4.07 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
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
name: CI
on: [push, pull_request]
jobs:
build:
name: Build OpenLauncher
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu
rid: linux-x64
- os: windows
rid: win-x64
- os: macos
rid: macos-universal
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v6
with:
dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore
- name: Build
if: runner.os != 'macOS'
run: dotnet build -c Release --no-restore
- name: Test
if: runner.os != 'macOS'
run: dotnet test --no-restore
- name: Publish
working-directory: src/openlauncher
if: runner.os != 'macOS'
run: dotnet publish -c Release -r ${{ matrix.rid }} --self-contained
- name: Build (macOS)
if: runner.os == 'macOS'
run: ./build-mac.sh
- name: Package (macOS)
if: runner.os == 'macOS'
run: ./package-mac.sh
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: OpenLauncher-${{ matrix.rid }}
path: src/openlauncher/bin/Release/net8.0/${{ matrix.rid }}/publish/**/*
if-no-files-found: error
package:
name: deb and rpm packaging
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v6
with:
dotnet-version: '8.0.x'
- name: Restore
run: dotnet restore
- name: Publish
working-directory: src/openlauncher
run: dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true -p:SelfContained=false -p UseAppHost=true -p:EnableCompressionInSingleFile=false # Build to use OS runtime, has to be architecture dependent per documentation :(
- name: Prepare to create deb and rpm files
run: |
mkdir -p .pkg/usr/bin
mkdir -p .pkg/usr/share/applications
mkdir -p .pkg/usr/share/icons
cp src/openlauncher/resources/logo.svg .pkg/usr/share/icons/openlauncher.svg
cp src/openlauncher/resources/OpenLauncher.desktop .pkg/usr/share/applications/OpenLauncher.desktop
cp src/openlauncher/bin/Release/net8.0/linux-x64/publish/openlauncher .pkg/usr/bin/openlauncher
chmod +x .pkg/usr/bin/openlauncher
- name: Create rpm
uses: jiro4989/build-rpm-action@v2
with:
package: openlauncher
summary: 'A launcher for automatically downloading the latest, or specific versions of OpenRCT2 and OpenLoco.'
package_root: .pkg
maintainer: Ted John
version: ${{github.ref_name}} # refs/tags/v*.*.*
arch: 'x86_64'
license: 'MIT'
requires: dotnet-runtime-8.0
- name: Create deb
uses: jiro4989/build-deb-action@v4
with:
package: openlauncher
package_root: .pkg
maintainer: Ted John
version: ${{github.ref_name}} # refs/tags/v*.*.*
arch: 'amd64'
desc: 'A launcher for automatically downloading the latest, or specific versions of OpenRCT2 and OpenLoco.'
depends: dotnet-runtime-8.0
- uses: actions/upload-artifact@v7
with:
name: artifact-deb-rpm
path: |
./*.deb
./*.rpm
!./*-debuginfo-*.rpm
release:
name: Create release
runs-on: ubuntu-latest
needs: [build, package]
steps:
- uses: actions/download-artifact@v8
with:
merge-multiple: true
path: artifacts/
- uses: softprops/action-gh-release@v3
with:
files: |
# List to exclude pdb
artifacts/openlauncher
artifacts/openlauncher*.exe
artifacts/openlauncher*.rpm
artifacts/openlauncher*.deb
artifacts/OpenLauncher*.zip