Skip to content

Build MdtestV5

Build MdtestV5 #47

Workflow file for this run

name: Build MdtestV5
on:
repository_dispatch:
types: [build-mdtest]
workflow_dispatch:
concurrency:
group: check-and-build-mdtest
jobs:
get_commit_hash:
runs-on: ubuntu-latest
outputs:
commit-hash: ${{ steps.get-commit-hash.outputs.commit_hash }}
steps:
- name: Get Commit Hash
id: get-commit-hash
run: |
git clone --depth 1 https://github.com/tulir/whatsmeow
cd whatsmeow
echo "commit_hash=$(git show HEAD | grep -Eo '^commit [0-9a-f]{40}' | awk '{print $2}')" >> "$GITHUB_OUTPUT"
build_mdtest:
needs: get_commit_hash
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
platform: [arm, aarch64, i686, x86_64]
steps:
- 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 Mdtest
run: |
# Support for ARM and AARCH64
if [[ "${{ matrix.platform }}" == "arm" || "${{ matrix.platform }}" == "aarch64" ]]; then
docker run --rm --privileged aptman/qus -s -- -p arm aarch64
fi
docker run --privileged --name "mdtest-${{ env.ARCH_NAME }}" "termux/termux-docker:${{ matrix.platform }}" bash -c "
while true; do yes | pkg upgrade -y && break; done && \
pkg install -y git && \
export TERMUX_VERSION="0.118.0" && \
git clone --depth 1 'https://github.com/$GITHUB_REPOSITORY' repo && \
cd repo && \
bash build_whatsmeow5.sh \
"
docker cp "mdtest-${{ env.ARCH_NAME }}":/data/data/com.termux/files/home/repo/build/mdtest.zip .
- name: Upload Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: mdtest.zip
asset_name: "mdtest-${{ env.ARCH_NAME }}.zip"
tag: "MdtestV5-Assets"
release_name: "Assets for Project MdtestV5"
body: "This release of MdtestV5 uses whatsmeow repo commit hash: ${{needs.get_commit_hash.outputs.commit-hash}}"
overwrite: true