2021-09-17 20:06:06 +02:00
|
|
|
name: Generate bootstrap archives
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * 0"
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch:
|
|
|
|
- aarch64
|
|
|
|
- arm
|
|
|
|
- i686
|
|
|
|
- x86_64
|
|
|
|
steps:
|
|
|
|
- name: Git clone
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Create bootstrap archive
|
|
|
|
run: ./scripts/generate-bootstraps.sh --architectures ${{ matrix.arch }}
|
2021-09-17 20:49:08 +02:00
|
|
|
- name: Store artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: bootstrap-archives-${{ github.sha }}
|
|
|
|
path: "*.zip"
|
|
|
|
publish:
|
2021-09-17 20:52:48 +02:00
|
|
|
needs: build
|
2021-09-17 20:49:08 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Git clone
|
|
|
|
uses: actions/checkout@v2
|
2021-09-17 21:06:18 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-09-17 20:49:08 +02:00
|
|
|
- name: Fetch bootstrap archives
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: bootstrap-archives-${{ github.sha }}
|
|
|
|
path: ./
|
2021-09-17 21:02:25 +02:00
|
|
|
- name: Get checksums
|
|
|
|
id: get_checksums
|
2021-09-17 21:17:26 +02:00
|
|
|
run: |
|
|
|
|
checksums=$(printf 'SHA-256:\n```\n%s\n```\n' "$(sha256sum *.zip)")
|
|
|
|
checksums="${checksums//'%'/'%25'}"
|
|
|
|
checksums="${checksums//$'\n'/'%0A'}"
|
|
|
|
checksums="${checksums//$'\r'/'%0D'}"
|
|
|
|
echo "::set-output name=checksums::$checksums"
|
2021-09-17 20:41:46 +02:00
|
|
|
- name: Create new tag
|
2021-09-17 20:46:21 +02:00
|
|
|
id: get_tag
|
2021-09-17 20:41:46 +02:00
|
|
|
run: |
|
|
|
|
new_tag="bootstrap-$(date "+%Y.%m.%d")"
|
2021-09-17 22:39:35 +02:00
|
|
|
existing_tag_revision=$(git tag | grep "$new_tag" | sort -r | head -n 1 | cut -d- -f3 | cut -dr -f2)
|
2021-09-17 20:57:42 +02:00
|
|
|
if [ -n "$existing_tag_revision" ]; then
|
2021-09-17 20:41:46 +02:00
|
|
|
tag_rev=$((existing_tag_revision + 1))
|
|
|
|
else
|
|
|
|
tag_rev=1
|
|
|
|
fi
|
|
|
|
new_tag="${new_tag}-r${tag_rev}"
|
|
|
|
git tag "$new_tag"
|
|
|
|
git push --tags
|
|
|
|
echo "::set-output name=tag_name::$new_tag"
|
|
|
|
- name: Publish GitHub release
|
|
|
|
uses: svenstaro/upload-release-action@v2
|
|
|
|
with:
|
|
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
file: "*.zip"
|
|
|
|
file_glob: true
|
|
|
|
release_name: "Bootstrap archives for Termux application"
|
|
|
|
tag: ${{ steps.get_tag.outputs.tag_name }}
|
2021-09-17 21:17:26 +02:00
|
|
|
body: ${{ steps.get_checksums.outputs.checksums }}
|