-
Notifications
You must be signed in to change notification settings - Fork 2
159 lines (140 loc) · 5.3 KB
/
all.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Build
on:
pull_request: null
workflow_dispatch:
inputs:
myCommit:
description: Commit SHA1
required: false
default: ''
type: string
push:
branches:
- master
release:
types:
- published
env:
DEPS_VERSION: r3
# NDK version should match with the one in the main repo!
NDK_REVISION: r26d
jobs:
build:
strategy:
fail-fast: false
matrix:
configuration:
- Debug
- Release
- RelWithDebInfo
target:
- windows_x86
- windows_x86_64
- darwin_arm64
- darwin_x86_64
- linux_x86
- linux_x86_64
- android_x86
- android_x86_64
- android_arm32
- android_arm64
include:
- {target: windows_x86, platform: windows, architecture: x86, os: windows-2022, shell: 'msys2 {0}'}
- {target: windows_x86_64, platform: windows, architecture: x86_64, os: windows-2022, shell: 'msys2 {0}'}
- {target: darwin_arm64, platform: darwin, architecture: arm64, os: macos-14, shell: bash}
- {target: darwin_x86_64, platform: darwin, architecture: x86_64, os: macos-14, shell: bash}
- {target: linux_x86, platform: linux, architecture: x86, os: ubuntu-22.04, shell: bash}
- {target: linux_x86_64, platform: linux, architecture: x86_64, os: ubuntu-22.04, shell: bash}
- {target: android_x86, platform: android, architecture: x86, os: ubuntu-22.04, shell: bash}
- {target: android_x86_64, platform: android, architecture: x86_64, os: ubuntu-22.04, shell: bash}
- {target: android_arm32, platform: android, architecture: arm32, os: ubuntu-22.04, shell: bash}
- {target: android_arm64, platform: android, architecture: arm64, os: ubuntu-22.04, shell: bash}
runs-on: ${{matrix.os}}
defaults:
run:
shell: ${{matrix.shell}}
steps:
- name: 'Inject Slug/Short Variables'
uses: rlespinasse/github-slug-action@v4
- name: '[windows] Setup msys'
if: matrix.platform == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: make yasm zip
path-type: inherit
release: false # Reuse existing msys installation that's part of a runner image.
- name: 'Checkout'
uses: actions/checkout@v3
with:
submodules: recursive
ref: '${{inputs.myCommit}}'
- name: '[windows] Setup MSVC'
if: matrix.platform == 'windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: '${{matrix.architecture}}'
# Ironically, this is what the official build guide is recommending to do:
# https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC
- name: '[windows] Drop link.exe'
if: matrix.platform == 'windows'
run: |
rm -rf /usr/bin/link.exe
which link.exe
- name: '[darwin] Install dependencies'
if: matrix.platform == 'darwin'
run: |
brew install yasm
- name: '[linux] Install Dependencies'
if: matrix.platform == 'linux'
run: |
ARCH=
if [[ "${{matrix.architecture}}" = "x86" ]]; then
sudo dpkg --add-architecture i386
ARCH=:i386
fi
sudo apt-get update
sudo apt-get install -y yasm
[[ ! -z "$ARCH" ]] && sudo apt-get install -y gcc-multilib g++-multilib
# libasound2-dev is for ALSA, libpulse-dev is for PulseAudio, we want to have both as backends for OpenAL.
sudo apt-get install -y "libasound2-dev$ARCH" "libpulse-dev$ARCH"
- name: '[android] Install Dependencies'
if: matrix.platform == 'android'
run: |
if [[ "${{matrix.architecture}}" = "x86_64" ]]; then
sudo apt-get install -y yasm
fi
- name: '[android] Setup NDK'
if: matrix.platform == 'android'
id: setup-ndk
uses: nttld/setup-ndk@v1.3.1
with:
ndk-version: '${{env.NDK_REVISION}}'
add-to-path: false
local-cache: true
link-to-sdk: true
- name: '[android] Set ANDROID_NDK'
if: matrix.platform == 'android'
run: |
echo "ANDROID_NDK=${{steps.setup-ndk.outputs.ndk-path}}" >> $GITHUB_ENV
- name: 'Variables'
run: |
echo "ZIP_NAME=${{matrix.platform}}_${{matrix.configuration}}_${{matrix.architecture}}.zip" >> $GITHUB_ENV
- name: 'Build'
run: |
./scripts/build_all.sh -j4 ${{matrix.platform}} ${{matrix.architecture}} ${{matrix.configuration}} repos "${{env.ZIP_NAME}}"
- name: 'Print info'
if: always()
run: |
./scripts/print_info.sh
- name: 'Publish release'
id: release
continue-on-error: true
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: 'deps_${{env.DEPS_VERSION}}_${{env.GITHUB_REF_NAME_SLUG}}'
files: '${{env.ZIP_NAME}}'
#show success if release published failed on pr
- run: echo "OK"
if: job.steps.release.status == failure() && github.event_name == 'pull_request'