forked from alexcrichton/rustc-auto-publish
-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (32 loc) · 1 KB
/
main.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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
schedule:
# run the build every Sunday at 8am
- cron: "0 8 * * 0"
jobs:
run:
name: Run
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
run: |
rustup update --no-self-update stable && rustup default stable
- name: Cache Dependencies
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894
- run: cargo build
- name: Configure crates.io token
run: |
echo "[registry]" > $HOME/.cargo/credentials
echo "token = \"${{ secrets.CRATESIO_TOKEN }}\"" >> $HOME/.cargo/credentials
if: github.event_name != 'pull_request'
- run: cargo run publish ${{ secrets.GH_TOKEN }}
if: github.event_name != 'pull_request'
- run: cargo run nopublish ${{ secrets.GH_TOKEN }}
if: github.event_name == 'pull_request'