-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (54 loc) · 1.44 KB
/
Copy pathrust.yml
File metadata and controls
66 lines (54 loc) · 1.44 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
name: Rust CI
on:
push:
branches:
- '*test*'
- main
tags:
- 'v*'
pull_request:
branches:
- main
permissions:
contents: write
issues: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev
- name: Run tests
run: |
cargo build --verbose
cargo test --verbose
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build the release binary
run: |
cargo build --release
VERSION=${GITHUB_REF##*/}
mv target/release/birdfetch target/release/birdfetch-${VERSION}
- name: Create GitHub Release and Upload Binary
run: |
VERSION=${GITHUB_REF##*/}
echo "Binary name: birdfetch-${VERSION}"
gh release create "v${VERSION}" target/release/birdfetch-${VERSION} --title "Release v${VERSION}" --notes "Release notes for v${VERSION}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}