Skip to content

Commit

Permalink
Merge pull request #3 from franzs/refactor_names
Browse files Browse the repository at this point in the history
Refactor names
  • Loading branch information
franzs authored Aug 26, 2024
2 parents 787b7af + e2d0f95 commit 88a1113
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/download-and-release-apk.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: |
Expand All @@ -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"
Expand All @@ -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 }}
Expand Down

0 comments on commit 88a1113

Please sign in to comment.