Skip to content

Commit

Permalink
update latest url
Browse files Browse the repository at this point in the history
  • Loading branch information
WardLordRuby committed Oct 27, 2024
1 parent b501edb commit d53c8a3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ name: Update download counts

on:
schedule:
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
- cron: '0 0,8,16 * * *' # Run every 8 hours
workflow_dispatch: # Allows manual triggering

jobs:
update-remote-gist:
runs-on: ubuntu-latest
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
REPO_FULL: ${{ github.repository }}

steps:
- name: Restore cached binary
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
if: ${{ !steps.cache.outputs.cache-hit || steps.check_ver.outputs.exit_code == '70' }}
continue-on-error: true
run: |
wget "https://drive.google.com/uc?export=download&id=1yHF8B0YynKglsOOsGAb5VXzOCAsCKW5o" -O ./nexus-mods.gz
wget "https://github.com/WardLordRuby/nexus_badges/releases/latest/download/nexus_badges_linux_amd64.gz" -O ./nexus-mods.gz
echo "cache_key_new=${{ runner.os }}-binary-nexus-badges-${{ github.run_id }}-${{ github.run_attempt }}" >> $GITHUB_OUTPUT
- name: Cache latest binary
Expand All @@ -57,17 +58,13 @@ jobs:
chmod +x ./nexus-mods
- name: Set cache key
if: ${{ !steps.cache.outputs.cache-hit && steps.cache_latest.outcome == 'success' }}
if: ${{ steps.cache_latest.outcome == 'success' && !steps.cache.outputs.cache-hit }}
continue-on-error: true
env:
REPO_FULL: ${{ github.repository }}
run: ./nexus-mods --remote update-cache-key --new ${{ steps.download_latest.outputs.cache_key_new }}

- name: Remove old cache & update cache key
if: ${{ steps.cache.outputs.cache-hit && steps.cache_latest.outcome == 'success' }}
if: ${{ steps.cache_latest.outcome == 'success' && steps.cache.outputs.cache-hit }}
continue-on-error: true
env:
REPO_FULL: ${{ github.repository }}
run: ./nexus-mods --remote update-cache-key --old ${{ vars.CACHED_BIN }} --new ${{ steps.download_latest.outputs.cache_key_new }}

- name: Run binary
Expand Down

0 comments on commit d53c8a3

Please sign in to comment.