-
-
Notifications
You must be signed in to change notification settings - Fork 10
110 lines (101 loc) · 3.02 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Build
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
build-dummy:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install meson
run: python -m pip install meson ninja
- name: Setup
working-directory: dummy-service
run: meson setup build
- name: Build
working-directory: dummy-service
run: meson compile -C build
- name: Copy files
run: copy .\dummy-service\build\*.exe .\dummy-service
- name: Create a dummy-service archive
shell: bash
working-directory: ./dummy-service
run: 7z a ../dummy-service.zip ./*.{exe,bat}
- uses: actions/upload-artifact@v4
with:
name: dummy-GalaxyCommunication.exe
path: |
dummy-service/*.exe
dummy-service.zip
build:
strategy:
matrix:
target:
[
x86_64-unknown-linux-gnu,
aarch64-unknown-linux-gnu,
x86_64-apple-darwin,
aarch64-apple-darwin,
x86_64-pc-windows-msvc,
aarch64-pc-windows-msvc,
]
runs-on: ${{ (contains(matrix.target, 'apple-darwin') && 'macos-latest') ||
(contains(matrix.target, 'linux-gnu') && 'ubuntu-latest') ||
(contains(matrix.target, 'pc-windows') && 'windows-latest') }}
needs: build-dummy
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
name: Install arm gcc
run: sudo apt install gcc-aarch64-linux-gnu
- name: Setup target
run: rustup target add ${{ matrix.target }}
- name: Build
run: cargo build --verbose --release --target ${{ matrix.target }}
- name: Download dummy service for packaging
uses: actions/download-artifact@v4
with:
name: dummy-GalaxyCommunication.exe
path: .
- name: Copy files
shell: bash
run: ci/package-build.sh ${{ matrix.target }}
- name: Create Steam Deck archive
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }}
run: |
7z a steam-deck.zip comet* docs/steamdeck/ dummy-service/*.{exe,md,bat} && \
7z rn steam-deck.zip comet-x86_64-unknown-linux-gnu comet
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: comet-${{ matrix.target }}
path: |
comet*
steam-deck.zip
draft-release:
permissions:
contents: write
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: build
steps:
- name: Download builds
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create draft
uses: softprops/action-gh-release@v2
with:
draft: true
generate_release_notes: true
files: |
comet*
*.zip