-
-
Notifications
You must be signed in to change notification settings - Fork 100
139 lines (122 loc) · 5.24 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
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
139
name: Build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
NAME: cemu
REPO: hugsy/cemu
VERSION: 0.8.0
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
python-version: ['3.10', '3.11', '3.12']
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
outputs:
windows-2019-3-10: ${{ join(steps.*.outputs.windows-2019-3-10,'') }}
windows-2019-3-11: ${{ join(steps.*.outputs.windows-2019-3-11,'') }}
windows-2019-3-12: ${{ join(steps.*.outputs.windows-2019-3-12,'') }}
ubuntu-22-04-3-10: ${{ join(steps.*.outputs.ubuntu-22-04-3-10,'') }}
ubuntu-22-04-3-11: ${{ join(steps.*.outputs.ubuntu-22-04-3-11,'') }}
ubuntu-22-04-3-12: ${{ join(steps.*.outputs.ubuntu-22-04-3-12,'') }}
macos-13-3-10: ${{ join(steps.*.outputs.macos-13-3-10,'') }}
macos-13-3-11: ${{ join(steps.*.outputs.macos-13-3-11,'') }}
macos-13-3-12: ${{ join(steps.*.outputs.macos-13-3-12,'') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: "Install Pre-requisite"
uses: eifinger/setup-rye@v4
with:
version: 'latest'
- name: "Install Pre-requisite (Linux)"
if: startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
sudo apt update
sudo apt install -y build-essential libegl1
- run: rye fmt
- run: rye lint
- run: rye test
- run: rye build --wheel --out ./build
- name: Publish artifact
id: publish_artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.NAME }}_${{ env.VERSION }}_${{ matrix.os }}_py${{ matrix.python-version }}_${{ github.sha }}
path: build/
- name: Populate the successful output (Windows)
id: output_success_windows
if: ${{ startsWith(matrix.os, 'windows') && success() }}
shell: pwsh
run: |
$osVersion = "${{ matrix.os }}" -replace "\.", "-"
$pyVersion = "${{ matrix.python-version }}" -replace "\.", "-"
echo "${osVersion}-$pyVersion=✅ ${{ matrix.os }} ${{ matrix.python-version }}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Populate the successful output (Other)
id: output_success_other
if: ${{startsWith(matrix.os, 'windows') == false && success() }}
shell: bash
run: |
osVersion="$(echo -n ${{ matrix.os }} | tr . -)"
pyVersion="$(echo -n ${{ matrix.python-version }} | tr . -)"
echo "${osVersion}-${pyVersion}=✅ ${{ matrix.os }} ${{ matrix.python-version }}" >> $GITHUB_OUTPUT
- name: Populate the failure output (Windows)
id: output_failure_windows
if: ${{startsWith(matrix.os, 'windows') && failure() }}
shell: pwsh
run: |
$osVersion = "${{ matrix.os }}" -replace "\.", "-"
$pyVersion = "${{ matrix.python-version }}" -replace "\.", "-"
echo "${osVersion}-${pyVersion}=❌ ${{ matrix.os }} ${{ matrix.python-version }}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Populate the failure output (Other)
id: output_failure_other
if: ${{startsWith(matrix.os, 'windows') && failure() }}
shell: bash
run: |
osVersion="$(echo -n ${{ matrix.os }} | tr . -)"
pyVersion="$(echo -n ${{ matrix.python-version }} | tr . -)"
echo "${osVersion}-$pyVersion=❌ ${{ matrix.os }} ${{ matrix.python-version }}" >> $GITHUB_OUTPUT
notify:
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
runs-on: 'ubuntu-22.04'
needs: build
steps:
- name: Send Discord notification
env:
COMMIT_URL: "https://github.com/${{ env.REPO }}/commit/${{ github.sha }}"
RUN_URL: "https://github.com/${{ env.REPO }}/actions/runs/${{ github.run_id }}"
BRANCH_URL: "https://github.com/${{ env.REPO }}/tree/${{ github.ref_name }}"
AUTHOR_URL: "https://github.com/${{ github.actor }}"
uses: sarisia/actions-status-discord@v1.14.5
with:
nodetail: true
title: 🚧 🚧 Summary of Build `${{ github.sha }}` for `${{ env.REPO }}` 🚧 🚧
description: |
[Job #${{ github.run_number }}](${{ env.RUN_URL }}): CI build `${{ github.sha }}` initiated by [${{ github.actor }}](${{ env.AUTHOR_URL }}):
● Commit [${{ github.sha }}](${{ env.COMMIT_URL }})
● Branch [`${{ github.ref_name }}`](${{ env.BRANCH_URL }})
● [Detail Page](${{ env.RUN_URL }})
${{ needs.build.outputs.windows-2019-3-10 }}
${{ needs.build.outputs.windows-2019-3-11 }}
${{ needs.build.outputs.windows-2019-3-12 }}
${{ needs.build.outputs.ubuntu-22-04-3-10 }}
${{ needs.build.outputs.ubuntu-22-04-3-11 }}
${{ needs.build.outputs.ubuntu-22-04-3-12 }}
${{ needs.build.outputs.macos-13-3-10 }}
${{ needs.build.outputs.macos-13-3-11 }}
${{ needs.build.outputs.macos-13-3-12 }}
color: 0x0000ff
username: ${{ github.actor }} via GithubBot
avatar_url: "https://github.com/hugsy/cemu/blob/dev/cemu/img/new_logo.png?raw=true"