-
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (78 loc) · 2.39 KB
/
rust.yml
File metadata and controls
85 lines (78 loc) · 2.39 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
name: Rust
permissions:
contents: read
pull-requests: write
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
ubuntu-build:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-musl, x86_64-pc-windows-gnu]
steps:
- uses: actions/checkout@v4
- name: Cache dependencies
uses: Swatinem/rust-cache@v2.7.3
- name: Build for ${{ matrix.target }}
if: matrix.target != 'x86_64-unknown-linux-gnu'
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --all --release --target=${{ matrix.target }}
- name: Build for ${{ matrix.target }}
if: matrix.target == 'x86_64-unknown-linux-gnu'
run: cargo build --release --verbose
- name: Run tests
run: cargo test --release
- name: Copy build
run: find target -type f -name 'cloudflareddns' -or -name 'cloudflareddns.exe' | xargs -I '{}' mv '{}' .
- name: Run UPX
uses: crazy-max/ghaction-upx@v3
with:
version: latest
files: cloudflareddns*
args: -fq --ultra-brute
- name: Artefacts
uses: actions/upload-artifact@v4
with:
name: cloudflareddns-${{ matrix.target }}
compression-level: 9
path: |
LICENSE
README.md
config.ini.example
cloudflare*
macos-arm64-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Cache dependencies
uses: Swatinem/rust-cache@v2.7.3
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --release
- name: Copy build
run: find target -type f -name 'cloudflareddns' | xargs -I '{}' mv '{}' .
# - name: Run UPX
# run: |
# brew install upx
# upx -fq --ultra-brute cloudflareddns
# Error: upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05
- name: Artefacts
uses: actions/upload-artifact@v4
with:
name: cloudflareddns-${{ runner.os }}-${{ runner.arch }}
compression-level: 9
path: |
LICENSE
README.md
config.ini.example
cloudflare*