forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 6
159 lines (140 loc) · 7.33 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
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, push]
permissions:
contents: read # Fetch code (actions/checkout)
packages: write # Upload and publish packages to GitHub Packages
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
vcpkg_path: C:\mixxx-vcpkg
exe_suffix: .exe
nuget: $(vcpkg fetch nuget | tail -n 1)
vcpkg_bootstrap: .\bootstrap-vcpkg.bat
vcpkg_triplet: x64-windows
vcpkg_host_triplet: x64-windows
vcpkg_overlay_ports: overlay/windows;overlay/ports
vcpkg_packages_extras: libid3tag libmad
check_disk_space: Get-PSDrive
- os: macos-11
vcpkg_path: /Users/runner/mixxx-vcpkg
nuget: nuget
vcpkg_bootstrap: ./bootstrap-vcpkg.sh
vcpkg_triplet: x64-osx-min1015
vcpkg_host_triplet: x64-osx-min1015
vcpkg_overlay_ports: overlay/osx:overlay/ports
vcpkg_packages_extras:
vcpkg_cache: /Users/runner/.cache/vcpkg/archives
check_disk_space: df -h
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet }}
VCPKG_DEFAULT_HOST_TRIPLET: ${{ matrix.vcpkg_host_triplet }}
# Using the relative path overlay/triplets does not work (https://github.com/microsoft/vcpkg/issues/18764)
VCPKG_OVERLAY_TRIPLETS: ${{ matrix.vcpkg_path }}/overlay/triplets
VCPKG_OVERLAY_PORTS: ${{ matrix.vcpkg_overlay_ports }}
DEPS_BASE_NAME: mixxx-deps
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
MIXXX_VERSION: 2.5
name: ${{ matrix.vcpkg_triplet }}
runs-on: ${{ matrix.os }}
steps:
- name: Check out git repository
uses: actions/checkout@v3
with:
path: mixxx-vcpkg
# Workaround for issues https://github.com/microsoft/vcpkg/issues/8272
# and https://github.com/actions/checkout/issues/197
# to keep the build path short and work around size limits on the windows runner D: drive
- name: Move checkout
run: cmake -E copy_directory ${{ github.workspace }}/mixxx-vcpkg ${{ matrix.vcpkg_path }}
- name: Downgrade NuGet
if: runner.os == 'Windows'
run: |
choco install nuget.commandline --version 6.2.1 -y --allow-downgrade
- name: "Authenticate to GitHub Packages (readwrite)"
if: runner.os != 'Linux' && github.event_name == 'push'
shell: bash
run: |
nuget="${{ matrix.nuget }}"
"${nuget}" sources add -Name "mixxx-github-packages" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" -UserName "${{ github.repository_owner }}" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText
"${nuget}" setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
echo "VCPKG_BINARY_SOURCES=clear;nuget,mixxx-github-packages,readwrite;" >> "${GITHUB_ENV}"
- name: "Authenticate to GitHub Packages (read only)"
if: runner.os != 'Linux' && github.event_name == 'pull_request'
shell: bash
run: |
nuget="${{ matrix.nuget }}"
"${nuget}" sources add -Name "mixxx-github-packages" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" -UserName "${{ github.repository_owner }}" -Password "${{ secrets.GITHUB_TOKEN }}" -StorePasswordInClearText
"${nuget}" setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
echo "VCPKG_BINARY_SOURCES=clear;nuget,mixxx-github-packages,read;" >> "${GITHUB_ENV}"
- name: Read sha_short
id: vars
shell: bash
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
working-directory: ${{ matrix.vcpkg_path }}
# Cache the vcpkg executable to avoid bootstrapping each time
- name: "Setup vcpkg executable cache"
uses: actions/cache@v3
with:
path: ${{ matrix.vcpkg_path }}/vcpkg${{ matrix.exe_suffix }}
key: vcpkg-tool-${{ matrix.vcpkg_host_triplet }}-${{ github.ref }}-${{ github.run_number }}
restore-keys: |
key: vcpkg-tool-${{ matrix.vcpkg_host_triplet }}-${{ github.ref }}
key: vcpkg-tool-${{ matrix.vcpkg_host_triplet }}
- name: Bootstrap vcpkg
run: ${{ matrix.vcpkg_bootstrap }}
working-directory: ${{ matrix.vcpkg_path }}
- name: "[macOS] Bootstrap vcpkg"
if: runner.os == 'macOS'
run: |
brew update && brew install nasm automake pkg-config autoconf-archive
/bin/bash -c "sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer"
xcrun --show-sdk-version
- name: Check available disk space
run: ${{ matrix.check_disk_space }}
- name: Build packages
run: ./vcpkg install --vcpkg-root=${{ matrix.vcpkg_path }} --clean-after-build --recurse --feature-flags="-compilertracking,manifests,registries,versions" --x-abi-tools-use-exact-versions --debug
working-directory: ${{ matrix.vcpkg_path }}
- name: Upload GitHub Actions artifacts of build logs
if: always()
uses: actions/upload-artifact@v3
with:
name: logs-${{ matrix.vcpkg_triplet }}
path: ${{ matrix.vcpkg_path }}/buildtrees/**/*.log
- name: Create buildenv archive
run: ./vcpkg export --vcpkg-root=${{ matrix.vcpkg_path }} --x-all-installed --zip --output=${{ env.DEPS_BASE_NAME }}-${{ env.MIXXX_VERSION }}-${{ matrix.vcpkg_triplet }}-${{ steps.vars.outputs.sha_short }} --output-dir=${{ matrix.vcpkg_path }}
working-directory: ${{ matrix.vcpkg_path }}
- name: "[Windows] Install additional tools"
if: runner.os == 'Windows' && env.SSH_PASSWORD != null
env:
SSH_PASSWORD: ${{ secrets.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD }}
run: |
$Env:PATH="C:\msys64\usr\bin;$Env:PATH"
pacman -S --noconfirm coreutils bash rsync openssh
Add-Content -Path "$Env:GITHUB_ENV" -Value "PATH=$Env:PATH"
- name: "Upload build to downloads.mixxx.org"
if: github.event_name == 'push' && env.SSH_PASSWORD != null
run: bash .github/deploy.sh ${{ env.DEPS_BASE_NAME }}-${{ env.MIXXX_VERSION }}-${{ matrix.vcpkg_triplet }}-${{ steps.vars.outputs.sha_short }}.zip
working-directory: ${{ matrix.vcpkg_path }}
env:
DESTDIR: public_html/downloads/dependencies
OS: ${{ runner.os }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
SSH_HOST: downloads-hostgator.mixxx.org
SSH_KEY: ${{ secrets.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY }}
SSH_PASSWORD: ${{ secrets.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD }}
SSH_USER: mixxx
UPLOAD_ID: ${{ github.run_id }}
- name: Upload GitHub Actions artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.DEPS_BASE_NAME }}-${{ env.MIXXX_VERSION }}-${{ matrix.vcpkg_triplet }}-${{ steps.vars.outputs.sha_short }}
path: ${{ matrix.vcpkg_path }}/${{ env.DEPS_BASE_NAME }}-${{ env.MIXXX_VERSION }}-${{ matrix.vcpkg_triplet }}-${{ steps.vars.outputs.sha_short }}.zip
# Workaround for https://github.com/actions/cache/issues/531
- name: Use system tar & zstd from Chocolatey for caching
shell: bash
run: |
echo "C:/Windows/System32;C:/ProgramData/Chocolatey/bin" >> $GITHUB_PATH