device type and model fallback cases will always run #950
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create zip files | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| create-zip-files: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create name version env | |
| run: | | |
| sudo timedatectl set-timezone Asia/Singapore | |
| echo "DATE=$(date +%y.%m)" >> $GITHUB_ENV | |
| echo "COUNT=$(git rev-list --count HEAD --since=$(date --date="$(date +%Y-%m-01) - 1 second" +%s) | xargs printf "%02d")" >> $GITHUB_ENV | |
| - name: Move binaries | |
| run: | | |
| mkdir -p ./exclude/bin ./exclude/resources | |
| cp -R ./bin/* ./exclude/bin | |
| cp -R ./resources/* ./exclude/resources | |
| rm -rf ./bin/* ./resources/* | |
| mkdir -p ./bin/macos/arm64 ./bin/linux/arm64 ./bin/linux/x86_64 | |
| mv ./exclude/bin/linux/arm64/aria2c ./exclude/bin/linux/arm64/jq ./bin/linux/arm64 | |
| mv ./exclude/bin/linux/x86_64/aria2c ./exclude/bin/linux/x86_64/jq ./bin/linux/x86_64 | |
| mv ./exclude/bin/macos/aria2c ./exclude/bin/macos/jq ./bin/macos | |
| mv ./exclude/bin/macos/arm64/aria2c ./exclude/bin/macos/arm64/jq ./bin/macos/arm64 | |
| touch ./resources/new | |
| - name: Zip files | |
| run: zip -r ${{ github.event.repository.name }}_v${{ env.DATE }}.${{ env.COUNT }}.zip bin/ LICENSE resources/ restore.sh README.md | |
| - name: Remove all assets from latest release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| assets=$(gh release view latest --json assets -q '.assets[].name' || true) | |
| if [[ -z "$assets" ]]; then | |
| echo "No assets found on release 'latest'" | |
| exit 0 | |
| fi | |
| for asset in $assets; do | |
| echo "Deleting asset: $asset" | |
| gh release delete-asset latest "$asset" -R ${{ github.repository }} -y | |
| done | |
| - name: Update latest release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload latest \ | |
| ${{ github.event.repository.name }}_v${{ env.DATE }}.${{ env.COUNT }}.zip \ | |
| --clobber -R ${{ github.repository }} | |
| gh release edit latest \ | |
| --title "Latest-v${{ env.DATE }}.${{ env.COUNT }}" \ | |
| --target ${{ github.sha }} -R ${{ github.repository }} |