feat(versioning): update asset paths and versioning logic in HTML and scripts
This commit is contained in:
2
.github/workflows/build-apk.yml
vendored
2
.github/workflows/build-apk.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
||||
working-directory: android
|
||||
run: ./gradlew assembleDebug
|
||||
|
||||
- name: Upload APK
|
||||
- name: Upload APK>
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: impostor-game-debug
|
||||
|
||||
54
.github/workflows/version-assets.yml
vendored
Normal file
54
.github/workflows/version-assets.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Version Static Assets
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'www/script.js'
|
||||
- 'www/styles.css'
|
||||
- 'www/logo.png'
|
||||
- 'www/index.html'
|
||||
- 'version-assets.sh'
|
||||
- '.github/workflows/version-assets.yml'
|
||||
|
||||
jobs:
|
||||
version-assets:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.APP_SECRET }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Delete old versioned assets
|
||||
run: |
|
||||
echo "🗑️ Borrando archivos hasheados antiguos..."
|
||||
rm -f www/*.*.js www/*.*.css www/*.*.png || true
|
||||
git add -A
|
||||
|
||||
- name: Run asset versioning
|
||||
run: |
|
||||
chmod +x version-assets.sh
|
||||
./version-assets.sh
|
||||
|
||||
- name: Check for changes
|
||||
id: check_changes
|
||||
run: |
|
||||
if git diff --quiet && git diff --cached --quiet; then
|
||||
echo "changes=false" >> $GITHUB_OUTPUT
|
||||
echo "No hay cambios para commitear"
|
||||
else
|
||||
echo "changes=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Commit and push versioned assets
|
||||
if: steps.check_changes.outputs.changes == 'true'
|
||||
run: |
|
||||
git config --local user.email "ci@dariosevilla.es"
|
||||
git config --local user.name "CI Action"
|
||||
git add www/*.*.js www/*.*.css www/*.*.png www/index.html
|
||||
git commit -m "chore: update asset versions [skip ci]"
|
||||
git push
|
||||
Reference in New Issue
Block a user