This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
Build Executable #2
This file contains 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: 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 |