Generate bootstrap archives (android-7) #273
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: Generate bootstrap archives (android-7) | |
| on: | |
| schedule: | |
| - cron: "0 0 * * 0" | |
| workflow_dispatch: | |
| permissions: {} # none | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| permissions: | |
| contents: read # actions/upload-artifact doesn't need contents: write | |
| runs-on: ubuntu-slim | |
| strategy: | |
| matrix: | |
| arch: | |
| - aarch64 | |
| - arm | |
| - i686 | |
| - x86_64 | |
| if: github.repository == 'termux/termux-packages' | |
| steps: | |
| - name: Git clone | |
| uses: actions/checkout@v6 | |
| - name: Create bootstrap archive | |
| run: ./scripts/generate-bootstraps.sh --architectures ${{ matrix.arch }} | |
| - name: Store artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: bootstrap-archives-${{ matrix.arch }}-${{ github.sha }} | |
| path: "*.zip" | |
| publish: | |
| permissions: | |
| contents: write # for git push | |
| needs: build | |
| runs-on: ubuntu-slim | |
| steps: | |
| - name: Git clone | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch bootstrap archives | |
| uses: actions/download-artifact@v7 | |
| with: | |
| merge-multiple: true | |
| path: ./ | |
| - name: Create new tag | |
| id: get_tag | |
| run: | | |
| new_tag="bootstrap-$(date "+%Y.%m.%d")" | |
| existing_tag_revision=$(git tag | grep "$new_tag" | sort -r | head -n 1 | cut -d- -f3 | cut -dr -f2) | |
| if [ -n "$existing_tag_revision" ]; then | |
| tag_rev=$((existing_tag_revision + 1)) | |
| else | |
| tag_rev=1 | |
| fi | |
| new_tag="${new_tag}-r${tag_rev}+apt.android-7" | |
| echo "tag_name=$new_tag" >> $GITHUB_OUTPUT | |
| - name: Publish bootstrap zips to GitHub release | |
| run: | | |
| gh release create ${{ steps.get_tag.outputs.tag_name }} --title "Bootstrap archives for Termux application (apt.android-7)" | |
| for file in *.zip; do | |
| gh release upload ${{ steps.get_tag.outputs.tag_name }} "$file" | |
| done |