-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (79 loc) · 2.52 KB
/
rust.yml
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
89
90
91
92
93
94
name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
PROJECT_NAME: gitnote
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
libName: libgitnote.so
- name: win-amd64
runner: windows-latest
target: x86_64-pc-windows-msvc
libName: libgitnote.dll
- name: macos-amd64
runner: macos-latest
target: x86_64-apple-darwin
libName: libgitnote.dylib
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
libName: libgitnote.dylib
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build Binary
working-directory: ./gitnote-core
run: cargo build --lib --verbose --locked --release --target ${{ matrix.target }}
- name: Run tests
working-directory: ./gitnote-core
run: cargo test --lib --verbose
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}_${{ matrix.libName }}
path: ./gitnote-core/target/${{ matrix.target }}/release/${{ matrix.libName }}
collect:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ./libs
- name: list libs
run: ls -lR ./libs
- name: Move artifacts to resources
run: |
directory="libs"
for file in "$directory"/*; do
filename=$(basename "$file")
IFS='_' read -r dirname _ <<< "$filename"
echo "filename: $filename"
echo "dirname: $dirname"
echo "file: $file"
mkdir -p "./gitnote-jetbrains/src/main/resources/core/$dirname/$filename"
cp "$file" "./gitnote-jetbrains/src/main/resources/core/$dirname/$filename"
echo "Copied $file to ./$dirname/$filename/"
done
- name: list resources
run: ls -lR ./gitnote-jetbrains/src/main/resources/core/
- name: Build JAR
run: ./gradlew build