Skip to content

Commit

Permalink
test with version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Terzero committed Nov 21, 2023
1 parent 1d22c1f commit deb7d72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/check-for-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ on:
workflow_dispatch:

jobs:
# check_for_update:
# # output whether we want an update to be done
# outputs:
# DO_UPDATE: ${{ steps.check_for_update.outputs.DO_UPDATE }}
# NEW_VERSION: ${{ steps.check_for_update.outputs.NEW_VERSION }}
# runs-on: ubuntu-latest
# steps:
# -
# name: Checkout code
# uses: actions/checkout@v2
# -
# name: Check for a newer version
# run: bash check-for-latest.sh
# id: check_for_update
# - if: ${{ steps.check_for_update.outputs.DO_UPDATE == 1 }}
# run: echo UPDATING!
check_for_update:
# output whether we want an update to be done
outputs:
DO_UPDATE: ${{ steps.check_for_update.outputs.DO_UPDATE }}
NEW_VERSION: ${{ steps.check_for_update.outputs.NEW_VERSION }}
runs-on: ubuntu-latest
steps:
-
name: Checkout code
uses: actions/checkout@v2
-
name: Check for a newer version
run: bash check-for-latest.sh
id: check_for_update
- if: ${{ steps.check_for_update.outputs.DO_UPDATE == 1 }}
run: echo UPDATING!
get_and_build_update:
runs-on: ubuntu-latest
# needs: [check_for_update]
needs: [check_for_update]
# if: needs.check_for_update.outputs.DO_UPDATE == 1
steps:
-
Expand All @@ -42,8 +42,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: v7.9.8
release_name: Release v7.9.8
tag_name: v${{ needs.check_for_update.outputs.NEW_VERSION }}
release_name: Release v${{ needs.check_for_update.outputs.NEW_VERSION }}
draft: false
prerelease: false
-
Expand All @@ -55,7 +55,7 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./out/OpenXCOM_Extended-x86_64.AppImage
asset_name: OpenXCOM_Extended-v7.9.8-x86_64.AppImage
asset_name: OpenXCOM_Extended-v${{ needs.check_for_update.outputs.NEW_VERSION }}-x86_64.AppImage
asset_content_type: application/octet-stream
# -
# name: Build the container image
Expand Down
2 changes: 1 addition & 1 deletion check-for-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ if [ "$LATEST" = "$VERSION" ] && [ "$GITHUB_EVENT_NAME" != "workflow_dispatch" ]
else
echo "Latest version is $LATEST, VERSION file says $VERSION, update available"
echo '::set-output name=DO_UPDATE::1'
echo "::set-output name=NEW_VERSION::$LATEST"
fi

echo "::set-output name=NEW_VERSION::$LATEST"

0 comments on commit deb7d72

Please sign in to comment.