-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (74 loc) · 2.68 KB
/
Copy pathbuild.yml
File metadata and controls
88 lines (74 loc) · 2.68 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
name: Build
on:
push:
jobs:
build:
name: Build — ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl
binary: proxy-checker
artifact: proxy-checker-linux
- name: Windows
os: windows-latest
target: x86_64-pc-windows-msvc
binary: proxy-checker.exe
artifact: proxy-checker-windows
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install musl-tools
if: matrix.target == 'x86_64-unknown-linux-musl'
run: sudo apt-get install -y musl-tools
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: target/${{ matrix.target }}/release/${{ matrix.binary }}
if-no-files-found: error
release:
name: Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download Linux binary
uses: actions/download-artifact@v4
with:
name: proxy-checker-linux
path: artifacts/linux
- name: Download Windows binary
uses: actions/download-artifact@v4
with:
name: proxy-checker-windows
path: artifacts/windows
- name: Mark Linux binary executable
run: chmod +x artifacts/linux/proxy-checker
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/linux/proxy-checker
artifacts/windows/proxy-checker.exe