-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto-run
cargo release
when verison= line in Cargo.toml changes
- Loading branch information
1 parent
462b9ce
commit 86e7c03
Showing
3 changed files
with
45 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Tests | ||
|
||
on: push | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: "ubuntu-20.04" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install Rust | ||
run: rustup update | ||
- name: Run tests | ||
run: cargo test | ||
|
||
release-if-needed: | ||
runs-on: "ubuntu-20.04" | ||
needs: run-tests | ||
# Only run if tests passed and the branch is main. | ||
#if: ${{ github.ref == 'refs/heads/main' }} | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Check if version in Cargo.toml has changed | ||
id: project | ||
run: | | ||
git diff-tree -r -G'^version ?= ?"*"' --exit-code HEAD Cargo.toml || : "${VERSION_CHANGED:=1}" && : "${VERSION_CHANGED:=0}" | ||
echo "VERSION_CHANGED=${VERSION_CHANGED}" >> "$GITHUB_OUTPUT" | ||
- name: Install Rust | ||
if: steps.project.VERSION_CHANGED == '1' | ||
run: rustup update | ||
- name: Install cargo-release | ||
if: steps.project.VERSION_CHANGED == '1' | ||
run: cargo install cargo-release | ||
- name: Run cargo-release | ||
if: steps.project.VERSION_CHANGED == '1' | ||
run: cargo release | ||
#run: cargo release --execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters