2021-09-17 18:06:06 +00:00
|
|
|
name: Generate bootstrap archives
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * 0"
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2022-08-27 20:51:40 +00:00
|
|
|
permissions: {} # none
|
|
|
|
|
2022-05-22 09:22:47 +00:00
|
|
|
concurrency:
|
2022-05-29 00:28:33 +00:00
|
|
|
group: ${{ github.workflow }}
|
2022-05-22 09:22:47 +00:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-09-17 18:06:06 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-08-27 20:51:40 +00:00
|
|
|
permissions:
|
|
|
|
contents: read # actions/upload-artifact doesn't need contents: write
|
2021-09-17 18:06:06 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch:
|
|
|
|
- aarch64
|
|
|
|
- arm
|
|
|
|
- i686
|
|
|
|
- x86_64
|
2023-05-23 07:05:16 +00:00
|
|
|
if: github.repository == 'termux/termux-packages'
|
2021-09-17 18:06:06 +00:00
|
|
|
steps:
|
|
|
|
- name: Git clone
|
2022-04-26 14:11:35 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-09-17 18:06:06 +00:00
|
|
|
- name: Create bootstrap archive
|
|
|
|
run: ./scripts/generate-bootstraps.sh --architectures ${{ matrix.arch }}
|
2021-09-17 18:49:08 +00:00
|
|
|
- name: Store artifacts
|
2022-04-26 14:11:35 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-09-17 18:49:08 +00:00
|
|
|
with:
|
|
|
|
name: bootstrap-archives-${{ github.sha }}
|
|
|
|
path: "*.zip"
|
|
|
|
publish:
|
2022-08-27 20:51:40 +00:00
|
|
|
permissions:
|
|
|
|
contents: write # for git push
|
2021-09-17 18:52:48 +00:00
|
|
|
needs: build
|
2021-09-17 18:49:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Git clone
|
2022-04-26 14:11:35 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-09-17 19:06:18 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-09-17 18:49:08 +00:00
|
|
|
- name: Fetch bootstrap archives
|
2022-04-26 14:11:35 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2021-09-17 18:49:08 +00:00
|
|
|
with:
|
|
|
|
name: bootstrap-archives-${{ github.sha }}
|
|
|
|
path: ./
|
2021-09-17 18:41:46 +00:00
|
|
|
- name: Create new tag
|
2021-09-17 18:46:21 +00:00
|
|
|
id: get_tag
|
2021-09-17 18:41:46 +00:00
|
|
|
run: |
|
|
|
|
new_tag="bootstrap-$(date "+%Y.%m.%d")"
|
2021-09-17 20:39:35 +00:00
|
|
|
existing_tag_revision=$(git tag | grep "$new_tag" | sort -r | head -n 1 | cut -d- -f3 | cut -dr -f2)
|
2021-09-17 18:57:42 +00:00
|
|
|
if [ -n "$existing_tag_revision" ]; then
|
2021-09-17 18:41:46 +00:00
|
|
|
tag_rev=$((existing_tag_revision + 1))
|
|
|
|
else
|
|
|
|
tag_rev=1
|
|
|
|
fi
|
2022-04-28 20:03:18 +00:00
|
|
|
new_tag="${new_tag}-r${tag_rev}+apt-android-7"
|
2021-09-17 18:41:46 +00:00
|
|
|
git tag "$new_tag"
|
|
|
|
git push --tags
|
2022-12-27 10:23:24 +00:00
|
|
|
echo "tag_name=$new_tag" >> $GITHUB_OUTPUT
|
2022-09-17 00:00:46 +00:00
|
|
|
- name: Publish bootstrap zips to GitHub release
|
2023-01-04 13:12:03 +00:00
|
|
|
uses: termux/upload-release-action@v4.1.0
|
2021-09-17 18:41:46 +00:00
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-09-17 00:00:46 +00:00
|
|
|
file: "*.zip"
|
2021-09-17 18:41:46 +00:00
|
|
|
file_glob: true
|
|
|
|
release_name: "Bootstrap archives for Termux application"
|
|
|
|
tag: ${{ steps.get_tag.outputs.tag_name }}
|
2023-01-04 13:12:03 +00:00
|
|
|
checksums: sha256,sha512,md5
|