Skip to content

Commit

Permalink
Merge pull request #196 from tudat-team/195-fix-deprecation-bump-vers…
Browse files Browse the repository at this point in the history
…ion-workflow

Replace deprecated set-output Command with Environment Files in Nightly Bump Workflow
  • Loading branch information
DominicDirkx authored Nov 25, 2024
2 parents 51a4001 + c480486 commit 6d2445c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/bump_dev_version_nightly.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow is triggered at 3:00 AM CET everyday and checks if there has
# This workflow is triggered at 06:00 AM CET everyday and checks if there has
# been a commit in the last 24 hours on the develop branch of tudatpy repository.

# If there has been a commit, it bumps the version in the develop branch of
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
should_run: ${{ steps.should_bump_version.outputs.should_run }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -41,21 +41,24 @@ jobs:
run: git log -n 1 --pretty=format:"%H"


- id: should_run
- id: should_bump_version
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" $(git log -n 1 --pretty=format:"%H")) && echo "::set-output name=should_run::false"
run: |
STR=$(git rev-list --after="24 hours" $(git log -n 1 --pretty=format:"%H"))
if test -z $STR; then
echo "should_run=false" >> $GITHUB_OUTPUT
else
echo "should_run=true" >> $GITHUB_OUTPUT
fi
# If the latest commit is less than 24 hours old, the command git rev-list --after="24 hours" $(git log -n 1 --pretty=format:"%H") will return a non-empty string (list of commit ids in the last 24 hours), which will cause the test -z command to return false and the output should_run will not be set to false.
# test -z $STR checks if $STR is empty or not. If it is empty, it returns true, else false.

bump-version_tudatpy:
needs: check_recent_24h_commit
if: ${{ needs.check_recent_24h_commit.outputs.should_run != 'false' }}
if: ${{ needs.check_recent_24h_commit.outputs.should_run != 'false' && github.event_name == 'schedule' }}
runs-on: ubuntu-latest
name: Bump version in tudatpy repository
outputs:
new_version: ${{ steps.bump_version.outputs.new_version }}

steps:
- name: Checkout
Expand All @@ -80,7 +83,7 @@ jobs:

bump_version_tudatpy_feedstock:
needs: check_recent_24h_commit
if: ${{ needs.check_recent_24h_commit.outputs.should_run != 'false' }}
if: ${{ needs.check_recent_24h_commit.outputs.should_run != 'false' && github.event_name == 'schedule' }}
runs-on: ubuntu-latest
name: bump version and create tag in tudatpy-feedstock
steps:
Expand Down

0 comments on commit 6d2445c

Please sign in to comment.