-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (42 loc) · 1.33 KB
/
publish-for-all-projects.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
name: Publish for-all-projects
on:
push:
branches: master
pull_request:
concurrency:
group: ${{ github.ref }}-publish-for-all-projects
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
CARGO_VERSION: "" # Should be set in the job
jobs:
publish-for-all-projects:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: rust update & cargo version env set
run: |
rustup update
CARGO_VERSION=$(cargo --version | cut -d ' ' -f 2) && echo "CARGO_VERSION=$CARGO_VERSION" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: |
~/.cargo/
for-all-projects/target/
key: ${{ runner.os }}-${{ env.CARGO_VERSION }}-for-all-projects-${{ hashFiles('for-all-projects/Cargo.lock') }}
- working-directory: for-all-projects
run: |
cargo check
cargo fmt
cargo clippy
if [[ $(git diff --name-only) ]]; then
echo "::error::File change detected. Please check."
echo "::error::$(git diff --name-only)"
exit 1
fi
- uses: katyo/publish-crates@v2
with:
path: "for-all-projects"
registry-token: ${{ secrets.CARGO_API_TOKEN }}
dry-run: ${{ github.ref != 'refs/heads/master' }}