1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
name: snapshots
on:
schedule:
- cron: "15 01 * * *" # Daily at 01:15 UTC - Changed from 0:00 as Windows build were failing when snapshots were scheduled to build at 0:00
workflow_dispatch:
permissions:
contents: write
jobs:
snapshots-windows:
uses: ./.github/workflows/snapshots-windows.yml
secrets: inherit
snapshots-android:
uses: ./.github/workflows/snapshots-android.yml
secrets: inherit
snapshots:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'exult' }}
needs: [snapshots-windows, snapshots-android]
steps:
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: "windows snapshot"
- name: Download Android artifacts
uses: actions/download-artifact@v4
with:
name: "android snapshot"
- name: Check if artifacts downloaded
shell: bash
run: |
if [ -f Exult.exe ]; then
echo HAVE_WINDOWS_SNAPSHOT=true >> $GITHUB_ENV
else
echo HAVE_WINDOWS_SNAPSHOT=false >> $GITHUB_ENV
echo Couldn\'t find Exult.exe for Windows snapshot. No release will be made
fi
if [ -f exult-snapshot-signed.apk ]; then
echo HAVE_ANDROID_SNAPSHOT=true >> $GITHUB_ENV
else
echo HAVE_ANDROID_SNAPSHOT=false >> $GITHUB_ENV
echo Couldn\'t find exult-snapshot-signed.apk for Android snapshot. No release will be made
fi
echo "GITHUB_REF=v1.11.0.$(date --utc +'%Y%m%d')" >> $GITHUB_ENV
- name: Install SSH key
if: ${{ (env.HAVE_WINDOWS_SNAPSHOT == 'true' && env.HAVE_ANDROID_SNAPSHOT == 'true')}}
uses: shimataro/ssh-key-action@v2
with:
key: "${{ secrets.SSH_PRIVATE_KEY }}"
name: id_ed25519
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: VirusTotal Scan
if: ${{ (env.HAVE_WINDOWS_SNAPSHOT == 'true' && env.HAVE_ANDROID_SNAPSHOT == 'true')}}
id: scan_files
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
github_token: ${{ github.token }}
update_release_body: true
files: |
Exult.exe
ExultStudio.exe
ExultTools.exe
Gimp30Plugin.exe
exult_shp_win64.aseprite-extension
- name: Generate VirusTotal Body
if: ${{ (env.HAVE_WINDOWS_SNAPSHOT == 'true' && env.HAVE_ANDROID_SNAPSHOT == 'true')}}
run: |
echo "Snapshot ${{ env.GITHUB_REF }}" > body.txt
echo "" >> body.txt
echo "🛡 [VirusTotal GitHub Action](https://github.com/crazy-max/ghaction-virustotal) analysis:" >> body.txt
echo "" >> body.txt
analysis="${{ steps.scan_files.outputs.analysis }}"
while read -d, -r pair; do
IFS='=' read -r filename analysisURL <<<"$pair"
echo "* [$(basename $filename)]($analysisURL)" >> body.txt
done <<<"$analysis,"
- name: Create release
if: ${{ (env.HAVE_WINDOWS_SNAPSHOT == 'true' && env.HAVE_ANDROID_SNAPSHOT == 'true')}}
id: create_release
uses: softprops/action-gh-release@v2
with:
token: ${{ github.token }}
name: Snapshot ${{ env.GITHUB_REF }}
tag_name: snapshot-${{ env.GITHUB_REF }}
body_path: body.txt
prerelease: true
fail_on_unmatched_files: true
files: |
Exult.exe
ExultStudio.exe
ExultTools.exe
Gimp30Plugin.exe
exult_shp_win64.aseprite-extension
Keyring.zip
SFisland.zip
Sifixes.zip
exult-snapshot-signed.apk
exult-snapshot-debug.apk
- name: Upload snapshots
shell: bash
if: ${{ (env.HAVE_WINDOWS_SNAPSHOT == 'true' && env.HAVE_ANDROID_SNAPSHOT == 'true')}}
run: |
cd $GITHUB_WORKSPACE
(for ii in $(seq 1 5); do scp -o BatchMode=yes -o PasswordAuthentication=no -i ~/.ssh/id_ed25519 *.exe *.zip *.apk *.aseprite-extension ${{ secrets.SCP_HOST }}:${{ secrets.PROJECT_HOME }}/htdocs/snapshots/ && exit 0 || true; done; exit 255)
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
windows*
android*
failOnError: false
|