This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (58 loc) · 2.7 KB
/
build.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
name: Build Executable
on:
workflow_dispatch:
concurrency:
group: build-compgroups
jobs:
build_exec:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
platform: [arm, aarch64, i686, x86_64]
steps:
- name: Install Docker
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=\"$(dpkg --print-architecture)\" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo \"$VERSION_CODENAME\") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- name: Set Build Architecture
run: |
if [ "${{ matrix.platform }}" = "aarch64" ]; then
echo "arch_name=arm64" >> $GITHUB_ENV
elif [ "${{ matrix.platform }}" = "i686" ]; then
echo "arch_name=x86" >> $GITHUB_ENV
else
echo "arch_name=${{ matrix.platform }}" >> $GITHUB_ENV
fi
- name: Build Competition Groups Binary
run: |
mkdir -p build
# Support for ARM and AARCH64
if [[ "${{ matrix.platform }}" == "arm" || "${{ matrix.platform }}" == "aarch64" ]]; then
docker pull aptman/qus
docker run --rm --privileged aptman/qus -s -- -p arm aarch64
fi
docker pull termux/termux-docker:${{ matrix.platform }}
docker run --privileged --name cgroups-${{ matrix.platform }} termux/termux-docker:${{ matrix.platform }} bash -c "yes | pkg upgrade -y && pkg install -y git && git clone https://github.com/IMXEren/competition-groups --depth 1 repo && cd repo && bash build_package.sh"
docker cp cgroups-${{ matrix.platform }}:/data/data/com.termux/files/home/repo/build/cgroups.zip build/cgroups-${{ env.arch_name }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: cgroups-${{ env.arch_name }}
path: build/cgroups-${{ env.arch_name }}.zip
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/cgroups-${{ env.arch_name }}.zip
asset_name: cgroups-${{ env.arch_name }}.zip
tag: "Assets"
release_name: "Assets for Project"
overwrite: true