Add release checking to rust workflow
This commit is contained in:
parent
c96a8ea2e5
commit
69410274d7
1 changed files with 23 additions and 0 deletions
23
.github/workflows/rust.yml
vendored
23
.github/workflows/rust.yml
vendored
|
@ -10,6 +10,29 @@ env:
|
|||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
# Credit to https://github.com/Far-Beyond-Dev/Horizon/blob/main/.github/workflows/main.yml
|
||||
check-version:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
should_release: ${{ steps.check.outputs.should_release }}
|
||||
version: ${{ steps.check.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Check if Cargo.toml version changed
|
||||
id: check
|
||||
run: |
|
||||
CURRENT_VERSION=$(grep -m1 version Cargo.toml | cut -d '"' -f2)
|
||||
git checkout HEAD^1
|
||||
PREVIOUS_VERSION=$(grep -m1 version Cargo.toml | cut -d '"' -f2)
|
||||
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
|
||||
echo "should_release=true" >> $GITHUB_OUTPUT
|
||||
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "should_release=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue