-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (41 loc) · 1.61 KB
/
Copy pathbuild_database_maker.yaml
File metadata and controls
51 lines (41 loc) · 1.61 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
# It takes a lot of time
# to build the binary on every run,
# hence, I am making this workflow
# to create a binary only when
# a complete new change has been made.
# NOTE: I am not adding "on push" because
# a push on main can contain breaking changes.
name: Project Builder
on:
workflow_dispatch:
permissions:
contents: write
jobs:
create_rust_binary:
runs-on: ubuntu-latest
# Got to know this from: https://github.com/marketplace/actions/setup-git-config
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Rust installation
uses: dtolnay/rust-toolchain@stable
- name: adding musl tools
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Install musl target
run: rustup target add x86_64-unknown-linux-musl
- name: Build static binary
env:
RUSTFLAGS: -C target-feature=+crt-static
run: |
cargo build --release --target x86_64-unknown-linux-musl --bin cron-codeberg
cargo build --release --target x86_64-unknown-linux-musl --bin cron-github
cargo build --release --target x86_64-unknown-linux-musl --bin index-safe-repos
- name: Upload binary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload executables target/x86_64-unknown-linux-musl/release/cron-codeberg --clobber
gh release upload executables target/x86_64-unknown-linux-musl/release/cron-github --clobber
gh release upload executables target/x86_64-unknown-linux-musl/release/index-safe-repos --clobber