-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (61 loc) · 1.99 KB
/
Copy pathrelease.yml
File metadata and controls
78 lines (61 loc) · 1.99 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
name: Build & Release
on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
build:
name: Build for ${{ matrix.target }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: tar.gz
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
archive: tar.gz
- os: macos-latest
target: x86_64-apple-darwin
archive: zip
- os: macos-latest
target: aarch64-apple-darwin
archive: zip
- os: windows-latest
target: x86_64-pc-windows-msvc
archive: zip
runs-on: ${{ matrix.os }}
steps:
- name: 🛎 Checkout repository
uses: actions/checkout@v4
- name: 🛠 Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y pkg-config libssl-dev musl-tools
export OPENSSL_STATIC=1
export OPENSSL_DIR="/usr"
- name: 🛠 Install zip (Windows)
if: runner.os == 'Windows'
run: choco install zip -y
- name: 🛠 Install Rust toolchain
run: rustup target add ${{ matrix.target }}
- name: 🚀 Build binary
run: cargo build --release --target ${{ matrix.target }}
- name: 📦 Package binary
run: |
mkdir -p dist
if [ "${{ matrix.os }}" == "windows-latest" ]; then
zip -j dist/domain-grabber-${{ matrix.target }}.zip target/${{ matrix.target }}/release/domain-grabber-cli.exe
else
tar -czvf dist/domain-grabber-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release domain-grabber-cli
fi
shell: bash
- name: 🚢 Upload to GitHub Releases
uses: softprops/action-gh-release@v2
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}