-
-
Notifications
You must be signed in to change notification settings - Fork 65
106 lines (99 loc) · 3.77 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
name: Automated builds
on:
push:
branches:
- '**'
tags:
# Run when pushing version tags, since otherwise it's impossible to
# restart a successful build after pushing a tag
- '*.*.*'
pull_request:
branches:
- master
defaults:
run:
# This otherwise gets run under dash which does not support brace expansion
shell: bash
jobs:
build-focal:
name: Build on Ubuntu 20.04
runs-on: ubuntu-latest
container: robbert/docker-yabridge:focal
outputs:
artifact-name: ${{ env.ARCHIVE_NAME }}
steps:
- uses: actions/checkout@v3
# Needed for git-describe to do anything useful, the safe directory
# workaround is needed for https://github.com/actions/runner/issues/2033
- name: Fetch all git history
run: |
git config --global --add safe.directory /__w/yabridge/yabridge
git fetch --force --prune --tags --unshallow
- name: Determine build archive name
run: |
echo "ARCHIVE_NAME=yabridge-$(git describe --always).tar.gz" >> "$GITHUB_ENV"
- name: Build the binaries
run: |
mkdir -p /tmp/prefix
export WINEPREFIX=/tmp/prefix
# In this version we don't need to statically link libstdc++ since
# Ubuntu 20.04 and similar distros will ship with a version that's
# compatible with GCC 10, even if that's not the default GCC version
meson setup build --buildtype=release --cross-file=cross-wine.conf --unity=on --unity-size=10000 -Dbitbridge=true
ninja -C build
- name: Strip remaining debug symbols
run: strip build/libyabridge{,-chainloader}-{clap,vst2,vst3}.so build/yabridge-host{,-32}.exe.so
- name: Create an archive for the binaries
run: |
mkdir yabridge
cp build/libyabridge{,-chainloader}-{clap,vst2,vst3}.so build/yabridge-host{,-32}.exe{,.so} yabridge
cp CHANGELOG.md README.md yabridge
tar -caf "$ARCHIVE_NAME" yabridge
rm -rf yabridge
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARCHIVE_NAME }}
path: ${{ env.ARCHIVE_NAME }}
build-yabridgectl:
name: Build yabridgectl
runs-on: ubuntu-latest
container: robbert/docker-yabridge:focal
outputs:
artifact-name: ${{ env.ARCHIVE_NAME }}
defaults:
run:
working-directory: tools/yabridgectl
steps:
- uses: actions/checkout@v3
# Needed for git-describe to do anything useful, the safe directory
# workaround is needed for https://github.com/actions/runner/issues/2033
- name: Fetch all git history
run: |
git config --global --add safe.directory /__w/yabridge/yabridge
git fetch --force --prune --tags --unshallow
- name: Determine build archive name
run: |
echo "ARCHIVE_NAME=yabridgectl-$(git describe --always).tar.gz" >> "$GITHUB_ENV"
# FIXME: Needed as long as we use the docker image
- name: Install dependencies
run: |
apt-get update
apt-get install -y curl
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build the binaries
run: cargo build --release
- name: Strip remaining debug symbols
run: strip target/release/yabridgectl
- name: Create an archive for the binaries
run: |
mkdir yabridgectl
cp target/release/yabridgectl README.md yabridgectl
tar -caf "$ARCHIVE_NAME" yabridgectl
rm -rf yabridgectl
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARCHIVE_NAME }}
# For some reason there's no way to tell GitHub actions to run actions
# in a subdirectory
path: tools/yabridgectl/${{ env.ARCHIVE_NAME }}