From 89917b428d5b0f17b7ec8832b5ef0c148d471b00 Mon Sep 17 00:00:00 2001 From: Josh Karpel Date: Sun, 5 Jun 2022 12:20:25 -0500 Subject: [PATCH] Add GHA `publish` workflow (#12) --- .github/dependabot.yml | 2 ++ .github/workflows/pre-commit.yml | 10 ++++++++++ .github/workflows/publish.yml | 20 ++++++++++++++++++++ .github/workflows/tests.yml | 17 +++++++++++++---- 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e82d8f3..8dfde25 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,10 +5,12 @@ updates: directory: "/" schedule: interval: "weekly" + day: "tuesday" open-pull-requests-limit: 1 - package-ecosystem: "cargo" directory: "/" schedule: interval: "weekly" + day: "thursday" open-pull-requests-limit: 1 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 510e80a..9efbb72 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,8 +8,18 @@ on: jobs: pre-commit: + strategy: + fail-fast: false + matrix: + toolchain: [ stable ] + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v3.0.2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + override: true - uses: actions/setup-python@v3.1.2 - uses: pre-commit/action@v2.0.3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..54271ad --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,20 @@ +name: publish + +on: + release: + types: [ published ] + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3.0.2 + - uses: actions-rs/toolchain@v1.0.6 + with: + toolchain: stable + override: true + - uses: actions-rs/cargo@v1.0.1 + with: + command: publish + args: --token ${{ secrets.CRATES_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 91365e5..dd68d47 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,12 +15,21 @@ jobs: fail-fast: false matrix: platform: [ ubuntu-latest, macos-latest, windows-latest ] + toolchain: [ stable ] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v3.0.2 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions-rs/toolchain@v1.0.6 + with: + toolchain: ${{ matrix.toolchain }} + override: true + - uses: actions-rs/cargo@v1.0.1 + with: + command: build + args: --verbose --release + - uses: actions-rs/cargo@v1.0.1 + with: + command: test + args: --verbose --release