-
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (78 loc) · 2.5 KB
/
build-bootstraps.yml
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
# Adapted from
# https://github.com/termux/termux-packages/blob/master/.github/workflows/bootstrap_archives.yml
name: Build bootstraps
on:
- workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
env:
ANDROID_HOME: "/opt/termux/android-sdk"
NDK: "/opt/termux/android-ndk"
strategy:
matrix:
target_arch: [aarch64, arm, i686, x86_64]
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get packages from termux-packages
uses: actions/checkout@v4
with:
repository: termux/termux-packages
path: termux-packages
fetch-depth: 1
- name: Apply patches
run: |
for patch in patches/termux-packages/*; do
cp -r $patch termux-packages;
done
- name: Create bootstrap archive
working-directory: ./termux-packages
run: |
./scripts/run-docker.sh ./clean.sh
./scripts/run-docker.sh ./scripts/build-bootstraps.sh --android10 --architectures ${{ matrix.target_arch }}
- name: Store bootstrap
uses: actions/upload-artifact@v4
with:
name: bootstrap-${{ matrix.target_arch }}
path: "./termux-packages/*.zip"
publish:
permissions:
contents: write # for git push
needs: build
runs-on: ubuntu-latest
steps:
- name: Git clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch bootstrap archives
uses: actions/download-artifact@v4
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}"
git tag "$new_tag"
git push --tags
echo "tag_name=$new_tag" >> $GITHUB_OUTPUT
- name: Publish bootstrap zips to GitHub release
uses: termux/[email protected]
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 }}
checksums: sha256,sha512,md5