Skip to content

Commit

Permalink
github: action: Add version-manager job to automate version control b…
Browse files Browse the repository at this point in the history
…ased on release-tag
  • Loading branch information
RaulTrombin authored and patrickelectric committed Nov 1, 2023
1 parent 6f2c785 commit ead61d8
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,37 @@ jobs:
check-path: 'examples/cpp/'
exclude-regex: 'examples/cpp/build'

build-cpp:
version-manager:
needs: [quick-tests]
runs-on: ubuntu-latest
outputs:
head_hash: ${{ steps.head-hash.outputs.head_hash }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Rust setup
uses: actions-rs/[email protected]
with:
toolchain: nightly
override: true
- name: Modify version if release-tag
if: startsWith(github.ref, 'refs/tags/')
run: |
cargo install cargo-bump --force \
&& cargo bump ${{ github.ref_name }}
- name: Automatic commit for version upgrade
if: startsWith(github.ref, 'refs/tags/')
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
commit_message: "Cargo: Update the navigator-lib version to ${{ github.ref_name }}"
- name: Store the head actual hash
id: head-hash
run: echo "head_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT

build-cpp:
needs: version-manager
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand All @@ -63,7 +91,9 @@ jobs:
steps:
- name: Building ${{ matrix.TARGET }}
run: echo "${{ matrix.TARGET }}"
- uses: actions/checkout@master
- uses: actions/checkout@v3
with:
ref: ${{ needs.version-manager.outputs.head_hash }}
- name: Rust Setup
uses: actions-rs/[email protected]
with:
Expand Down Expand Up @@ -94,7 +124,7 @@ jobs:
path: dist

build-python:
needs: [quick-tests]
needs: version-manager
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -103,6 +133,8 @@ jobs:
libc: [auto, musllinux_1_1]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ needs.version-manager.outputs.head_hash }}
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand Down Expand Up @@ -190,7 +222,7 @@ jobs:
file_glob: true

deploy-doc:
needs: quick-tests
needs: version-manager
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit ead61d8

Please sign in to comment.