-
-
Notifications
You must be signed in to change notification settings - Fork 36
98 lines (83 loc) · 3.3 KB
/
ci-launcher.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
name: "CI-Launcher"
# Controls when the workflow will run
on:
# Triggers the workflow on push/pull events but only for the upcoming-nuget-release branch
push:
branches: [ upcoming-client-release ]
tags:
- "v*"
pull_request:
branches: [ upcoming-client-release ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
strategy:
matrix:
profile: [
{
name: Windows,
runs_on: windows-latest,
runtime_identifier: win-x64,
archive_name: otapi_launcher_win.zip,
release_tag: launcher-windows,
},
{
name: MacOS,
runs_on: macos-latest,
runtime_identifier: osx-x64,
archive_name: otapi_launcher_macos.zip,
release_tag: launcher-macos,
},
{
name: Linux,
runs_on: ubuntu-latest,
runtime_identifier: ubuntu.16.04-x64,
archive_name: otapi_launcher_linux.zip,
release_tag: launcher-linux,
},
]
name: Build ${{ matrix.profile.name }}
defaults:
run:
shell: bash
runs-on: ${{ matrix.profile.runs_on }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '9.0.x' # SDK Version to use; x will use the latest version of the 3.1 channel
# - name: MonoMod dev build
# run: dotnet nuget add source https://pkgs.dev.azure.com/MonoMod/MonoMod/_packaging/DevBuilds%40Local/nuget/v3/index.json -n DevBuilds@Local
- name: Build
run: |
cd OTAPI.Client.Launcher
dotnet publish -r ${{ matrix.profile.runtime_identifier }} --framework net9.0 -p:PublishReadyToRun=true --self-contained false -c Release
if ${{ matrix.profile.runs_on != 'macos-latest' }} ; then
7z a ../${{ matrix.profile.archive_name }} './bin/Release/net9.0/${{ matrix.profile.runtime_identifier }}/publish/*'
else
mkdir -p OTAPI.app/Contents/Resources
mv bin/Release/net9.0/osx-x64/publish OTAPI.app/Contents/MacOS
cp ../docs/MacOS.Info.plist OTAPI.app/Contents/Info.plist
cp OTAPI.osx.sh OTAPI.app/Contents/MacOS/OTAPI
chmod +x OTAPI.app/Contents/MacOS/OTAPI
7z a ../${{ matrix.profile.archive_name }} OTAPI.app
fi
# - uses: actions/upload-artifact@v2
# with:
# name: ${{ matrix.profile.name }} Launcher
# path: OTAPI.Client.Launcher/bin/Release/net9.0/${{ matrix.profile.runtime_identifier }}/publish
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ matrix.profile.release_tag }}
prerelease: true
title: "${{ matrix.profile.name }} Launcher"
files: |
LICENSE.txt
${{ matrix.profile.archive_name }}