From 888fb4213456ed73223b376279c6a6663b937dc0 Mon Sep 17 00:00:00 2001 From: Sunny Chung Date: Sat, 4 Nov 2023 10:06:49 +0800 Subject: [PATCH] add more linux distributions to github actions --- .github/workflows/release.yaml | 74 ++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 99c36512..b60cfcb7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -60,3 +60,77 @@ jobs: with: files: "./HelloHTTP-${{ github.ref_name }}-macos-${{ runner.arch }}.dmg" draft: true + build-other-linux-x64: + name: Build on ${{ matrix.distro_name }} x64 + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - distro_name: debian + image: debian:bullseye + container: ${{ matrix.image }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: '17' + - run: ./gradlew createDistributable packageDistributionForCurrentOS + - run: pushd ./build/compose/binaries/main/app && ls -al && tar -cvzf "app.tar.gz" "Hello HTTP" && mv "app.tar.gz" "../../../../../HelloHTTP-${{ github.ref_name }}-${{ matrix.distro_name }}-${{ runner.arch }}.tar.gz" && popd + - uses: softprops/action-gh-release@v1 + with: + files: "HelloHTTP-${{ github.ref_name }}-${{ matrix.distro_name }}-${{ runner.arch }}.tar.gz" + draft: true + build-other-linux-other-archs: + name: Build on ${{ matrix.distro }} ${{ matrix.arch }} + runs-on: ubuntu-22.04 + strategy: + matrix: + include: + - arch: armv7 + distro: bullseye + distro_name: debian + - arch: armv7 + distro: fedora_latest + distro_name: fedora + - arch: aarch64 + distro: bullseye + distro_name: debian + - arch: aarch64 + distro: ubuntu20.04 + distro_name: ubuntu + - arch: aarch64 + distro: fedora_latest + distro_name: fedora + steps: + - uses: actions/checkout@v4 + - uses: uraimo/run-on-arch-action@v2 + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} +# setup: | +# mkdir -p "${PWD}/artifacts" +# dockerRunArgs: | +# --volume "${PWD}/artifacts:/artifacts" + env: | + artifact_name: HelloHTTP-${{ github.ref_name }}-${{ matrix.distro_name }}-${{ matrix.arch }}.tar.gz + install: | + mkdir -p /wd + cd /wd + case "${{ matrix.distro }}" in + ubuntu*|bullseye) + apt-get update -q + apt-get install -q -y git binutils openjdk-17-jdk + ;; + fedora*) + dnf -y update + dnf -y install which git java-17-openjdk-devel + ;; + esac + run: | + ./gradlew createDistributable packageDistributionForCurrentOS + pushd ./build/compose/binaries/main/app && ls -al && tar -cvzf "app.tar.gz" "Hello HTTP" && mv "app.tar.gz" "../../../../../${artifact_name}" && popd + - uses: softprops/action-gh-release@v1 + with: + files: "HelloHTTP-${{ github.ref_name }}-${{ matrix.distro }}-${{ matrix.arch }}.zip" + draft: true