-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (48 loc) · 1.41 KB
/
nightly.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
name: metapac publish
on:
push:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.repository == 'ch32-rs/ch32-data' }}
steps:
- uses: actions/checkout@v3
- name: Use nightly Rust
run: |
rustup default nightly
rustup component add rustfmt
- name: Deploy SSH key
run: |
mkdir ~/.ssh
echo "${{ secrets.NIGHTLIES_KEY }}" > ~/.ssh/id_rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa github.com
- name: Build
run: |
COMMIT=$(git rev-parse HEAD)
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
mkdir -p build
git clone --depth 1 [email protected]:ch32-rs/ch32-metapac.git build/ch32-metapac/
./d gen
cd build/ch32-metapac/
cp -v ../../README.md .
cp -v ../../LICENSE* .
find src -iname '*.rs' -exec rustfmt -v {} \;
git init
git add .
git config user.name "ch32-data builder"
git config user.email "[email protected]"
git commit -m "ch32-rs/ch32-data master $COMMIT" --allow-empty
git tag -a ch32-data-$COMMIT -m "Generated from ch32-data $COMMIT"
- name: Test
run: |
cd build/ch32-metapac/
cargo doc --features ch32v307vct6,metadata
- name: Push
run: |
cd build/ch32-metapac/
git push origin main --follow-tags