excluding builds on subbranches
All checks were successful
Rust Cross-Platform Build / Detect Rust Project (push) Successful in 4s
Rust Cross-Platform Build / Run Tests (push) Successful in 1m36s
Rust Cross-Platform Build / Build (x86_64-unknown-linux-gnu) (push) Successful in 2m21s
Rust Cross-Platform Build / Build (x86_64-pc-windows-gnu) (push) Successful in 2m38s
All checks were successful
Rust Cross-Platform Build / Detect Rust Project (push) Successful in 4s
Rust Cross-Platform Build / Run Tests (push) Successful in 1m36s
Rust Cross-Platform Build / Build (x86_64-unknown-linux-gnu) (push) Successful in 2m21s
Rust Cross-Platform Build / Build (x86_64-pc-windows-gnu) (push) Successful in 2m38s
This commit is contained in:
36
.github/workflows/build.yml
vendored
36
.github/workflows/build.yml
vendored
@@ -149,13 +149,14 @@ jobs:
|
||||
path: |
|
||||
${{ needs.detect-project.outputs.project-dir }}/target/${{ matrix.target }}/release/${{ needs.detect-project.outputs.project-name }}${{ matrix.os == 'windows' && '.exe' || '' }}
|
||||
|
||||
set-tag:
|
||||
set-tag:
|
||||
name: Set Tag Name
|
||||
needs: [detect-project, build]
|
||||
if: ${{ !failure() && !cancelled() && github.event_name != 'pull_request' }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tag_name: ${{ steps.set_tag.outputs.tag_name }}
|
||||
should_tag: ${{ steps.set_tag.outputs.should_tag }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -179,21 +180,33 @@ jobs:
|
||||
major=$((major + 1))
|
||||
minor=0
|
||||
patch=0
|
||||
new_tag="v${major}.${minor}.${patch}"
|
||||
echo "tag_name=${new_tag}" >> $GITHUB_OUTPUT
|
||||
echo "should_tag=true" >> $GITHUB_OUTPUT
|
||||
echo "Creating new major version tag: ${new_tag}"
|
||||
|
||||
elif [[ "${GITHUB_REF}" == "refs/heads/development" ]]; then
|
||||
minor=$((minor + 1))
|
||||
patch=0
|
||||
elif [[ "${GITHUB_REF}" == "refs/heads/staging" ]]; then
|
||||
patch=$((patch + 1))
|
||||
else
|
||||
echo "Not on main, development, or staging branch. Using latest tag: $latest_tag"
|
||||
echo "Not building docker image for this branch."
|
||||
new_tag="$latest_tag"
|
||||
echo "tag_name=${new_tag}" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
new_tag="v${major}.${minor}.${patch}"
|
||||
echo "tag_name=${new_tag}" >> $GITHUB_OUTPUT
|
||||
echo "should_tag=true" >> $GITHUB_OUTPUT
|
||||
echo "Creating new minor version tag: ${new_tag}"
|
||||
|
||||
elif [[ "${GITHUB_REF}" == "refs/heads/staging" ]]; then
|
||||
patch=$((patch + 1))
|
||||
new_tag="v${major}.${minor}.${patch}"
|
||||
echo "tag_name=${new_tag}" >> $GITHUB_OUTPUT
|
||||
echo "should_tag=true" >> $GITHUB_OUTPUT
|
||||
echo "Creating new patch version tag: ${new_tag}"
|
||||
|
||||
else
|
||||
echo "Not on main, development, or staging branch."
|
||||
echo "Branch: ${GITHUB_REF}"
|
||||
echo "Skipping tag creation and Docker build."
|
||||
echo "should_tag=false" >> $GITHUB_OUTPUT
|
||||
# Don't set tag_name output for non-release branches
|
||||
fi
|
||||
|
||||
docker-build:
|
||||
name: Build and Push Docker Image
|
||||
@@ -257,7 +270,6 @@ jobs:
|
||||
git tag ${{ needs.set-tag.outputs.tag_name }}
|
||||
git push origin ${{ needs.set-tag.outputs.tag_name }}
|
||||
|
||||
|
||||
summary:
|
||||
name: Workflow Summary
|
||||
needs: [test, build, docker-build]
|
||||
|
Reference in New Issue
Block a user