diff --git a/.github/workflows/download-and-release-apk.yaml b/.github/workflows/download-and-release-apk.yaml index 17c132f..0fe3662 100644 --- a/.github/workflows/download-and-release-apk.yaml +++ b/.github/workflows/download-and-release-apk.yaml @@ -1,21 +1,17 @@ name: Download+Release Juggluco -# Controls when the workflow will run on: schedule: # * is a special character in YAML so you have to quote this string - - cron: '23 1 * * *' # Google causes problems sometimes when downloads are too frequent + - cron: '23 1 * * *' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - retrieve_apk: - # The type of runner that the job will run on + download_apk: runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Checkout uses: actions/checkout@v4 @@ -28,19 +24,17 @@ jobs: filename=$(ls -1 *.apk) echo "filename=${filename}" >> $GITHUB_ENV - - name: Store SHA256 hash of new apk + - name: Store SHA256 hash of apk run: | sha256sum "${{ env.filename }}" | cut -d " " -f 1 > hash_new_file echo "current_hash=$(cat hash_current_file)" >> $GITHUB_OUTPUT echo "new_hash=$(cat hash_new_file)" >> $GITHUB_OUTPUT release_apk: - # The type of runner that the job will run on runs-on: ubuntu-latest - needs: retrieve_apk + needs: download_apk if: ${{ needs.build.outputs.current_hash != needs.build.outputs.new_hash }} - # Steps represent a sequence of tasks that will be executed as part of the job steps: - name: Update current hash run: | @@ -66,7 +60,7 @@ jobs: curl --location --remote-name --output "${changelog}" "${url}" echo "changelog=${changelog}" >> $GITHUB_ENV - - name: Get changes + - name: Get changes from changelog run: | python_dir="parse_changelog" changes_file="changes.md" @@ -75,13 +69,13 @@ jobs: python "${python_dir}/parse_changelog.py" "${{ env.changelog }}" "${{ env.version }}" > "${changes_file}" echo "changes_file=${changes_file}" >> $GITHUB_ENV - - name: Commit and push the change + - name: Commit and push changes uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "Update for version ${{ env.version }}" file_pattern: "hash_current_file" - - name: Release apk if hashes are different + - name: Release apk uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.tagname }}