forked from ayn2op/discordo
-
Notifications
You must be signed in to change notification settings - Fork 12
94 lines (79 loc) · 2.63 KB
/
ci.yml
File metadata and controls
94 lines (79 loc) · 2.63 KB
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
name: ci
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-15-intel
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libdbus-1-dev pkg-config libchafa-dev libglib2.0-dev mold clang
echo "RUSTFLAGS=-C link-arg=-fuse-ld=mold" >> $GITHUB_ENV
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install llvm chafa pkg-config
echo "CC=$(brew --prefix llvm)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm)/bin/clang++" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$(brew --prefix chafa)/lib/pkgconfig:$(brew --prefix)/lib/pkgconfig:${PKG_CONFIG_PATH:-}" >> $GITHUB_ENV
- run: cargo test --release --target ${{ matrix.target }}
- run: cargo build --release --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: oxicord_${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/oxicord
target/${{ matrix.target }}/release/oxicord.exe
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Rename artifacts
run: |
mkdir release_assets
for target in artifacts/*; do
target_name=$(basename $target)
target_name=${target_name#oxicord_}
if [ -f "$target/oxicord.exe" ]; then
cp "$target/oxicord.exe" "release_assets/oxicord-${target_name}.exe"
else
cp "$target/oxicord" "release_assets/oxicord-${target_name}"
fi
done
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: release_assets/*
draft: true