Skip to content

Commit

Permalink
wip: set version
Browse files Browse the repository at this point in the history
  • Loading branch information
adwk67 committed Dec 5, 2024
1 parent a3d27b9 commit bf3d163
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,15 @@ jobs:
with:
crate: cargo-edit
bin: cargo-set-version
- name: Update version if PR
if: ${{ github.event_name == 'pull_request' }}
- name: Update version if PR against main branch
if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
- name: Update version if PR against non-main branch
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
run: |
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
PR_VERSION="${MANIFEST_VERSION}-pr${{ github.event.pull_request.number }}"
cargo set-version --offline --workspace "$PR_VERSION"
# Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the
# default value in the makefile if called from this action, but not otherwise (i.e. when called locally).
Expand Down Expand Up @@ -410,9 +416,15 @@ jobs:
with:
crate: cargo-edit
bin: cargo-set-version
- name: Update version if PR
if: ${{ github.event_name == 'pull_request' }}
- name: Update version if PR against main branch
if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
run: cargo set-version --offline --workspace 0.0.0-pr${{ github.event.pull_request.number }}
- name: Update version if PR against non-main branch
if: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/main' }}
run: |
MANIFEST_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
PR_VERSION="${MANIFEST_VERSION}-pr${{ github.event.pull_request.number }}"
cargo set-version --offline --workspace "$PR_VERSION"
- name: Build manifest list
run: |
# Creating manifest list
Expand Down

0 comments on commit bf3d163

Please sign in to comment.