-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (140 loc) · 4.72 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
name: Build
on:
push:
schedule:
- cron: 20 0 * * *
jobs:
build:
strategy:
fail-fast: false
matrix:
program:
- ares-deps
platform:
- name: windows-x64
os: windows-latest
compiler: clang++
windres: windres
shell: 'msys2 {0}'
msystem: clang64
install: mingw-w64-clang-x86_64-clang
- name: windows-arm64
os: windows-latest
compiler: clang++ --target=aarch64-w64-windows-gnu --sysroot=/clangarm64 -resource-dir=/clangarm64/lib/clang/$(basename "$(clang++ -print-resource-dir)")
windres: windres --target=aarch64-w64-windows-gnu
shell: 'msys2 {0}'
msystem: clang64
install: mingw-w64-clang-x86_64-clang mingw-w64-clang-aarch64-clang
- name: macos-universal
os: macos-latest
compiler: clang++
shell: sh
- name: linux-universal
os: ubuntu-latest
compiler: clang++
shell: sh
name: ${{ matrix.program }}-${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
defaults:
run:
shell: ${{ matrix.platform.shell }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install MSYS2 Dependencies
if: matrix.platform.shell == 'msys2 {0}'
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.platform.msystem }}
install: make ${{ matrix.platform.install }}
- name: Install Windows Dependencies
if: runner.os == 'Windows'
run: |
export PATH="/c/Users/runneradmin/.cargo/bin:$PATH" # correct on windows-latest as of 2024-02-19
if [[ ${{ matrix.platform.name }} == *-arm64 ]]; then
rustup toolchain install nightly
rustup default nightly
rustup target add aarch64-pc-windows-msvc
else
rustup toolchain install nightly
rustup default nightly
fi
- name: Install macOS Dependencies
if: runner.os == 'macOS'
run: |
brew install ninja cmake xcbeautify
rustup toolchain install nightly
rustup default nightly
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
- name: Set up MSVC environment
if: matrix.platform.msvc-arch != ''
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.platform.msvc-arch }}
- name: Build ares-deps
id: actually-build
shell: bash
working-directory: ${{ github.workspace }}
env:
envName: ${{ matrix.platform.name }}
run: |
./build_deps.sh RelWithDebInfo
- name: Publish Build Artifacts
uses: actions/upload-artifact@v4
with:
name: ares-deps-${{ matrix.platform.name }}
path: ${{ github.workspace }}/ares-deps
make-release:
name: Create and upload release
permissions:
contents: write
runs-on: ubuntu-22.04
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [build]
defaults:
run:
shell: bash
steps:
- name: Get Metadata
id: metadata
run: |
: Get Metadata
echo "version=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
- name: Download build artifacts
uses: actions/download-artifact@v4
- name: Package Dependencies
run: |
: Package Dependencies
shopt -s extglob
for dir in */; do
dir_name="${dir%/}"
tar -cvJf "${dir_name}.tar.xz" "$dir"
echo "Created archive: ${dir_name}.tar.xz"
done
ls
ls ${{ github.workspace }}/*
- name: Generate Checksums
run: |
: Generate Checksums
shopt -s extglob
echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
for file in ${{ github.workspace }}/@(*.tar.xz|*.zip); do
echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
done
ls
ls ${{ github.workspace }}/*
- name: Create Release
id: create_release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564
with:
draft: false
prerelease: false
tag_name: ${{ steps.metadata.outputs.version }}
name: ares dependencies, build ${{ steps.metadata.outputs.version }}
body_path: ${{ github.workspace }}/CHECKSUMS.txt
files: |
${{ github.workspace }}/ares-deps-windows-x64*.*
${{ github.workspace }}/ares-deps-windows-arm64*.*
${{ github.workspace }}/ares-deps-macos-universal*.*
${{ github.workspace }}/ares-deps-linux-universal*.*