Skip to content

Commit

Permalink
add linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelizimm committed Jan 17, 2025
1 parent 0638a06 commit 4d72709
Showing 1 changed file with 49 additions and 5 deletions.
54 changes: 49 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,60 @@ jobs:

build_linux:
name: "Build Linux"
uses: ./.github/workflows/release-linux.yml
runs-on: ${{ matrix.arch == 'x64' && 'ubuntu-22.04' || 'ubuntu-24.04-arm64-4-core' }}
needs: [do_release, get_version]
secrets: inherit
with:
version: ${{ needs.get_version.outputs.PET_VERSION }}
env:
DEBUG_FLAG: ${{ matrix.flavor == 'debug' && '-debug' || '' }}
TARGET_FLAG: ${{ matrix.flavor == 'release' && '--release' || '' }}
ARCH_FLAG: ${{ matrix.arch == 'x64' && 'x86_64' || 'aarch64' }}

strategy:
matrix:
arch: [x64, arm64]
flavor: [debug, release]

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Setup Build Environment
run: |
sudo apt-get update
sudo apt-get install -y cargo
- name: Setup Build Environment for arm64
if: matrix.arch == 'arm64'
run: |
rustup target add aarch64-unknown-linux-gnu
- name: Compile PET (${{ matrix.flavor }})
run: |
cargo clean
cargo build --target ${ARCH_FLAG}-unknown-linux-gnu ${TARGET_FLAG}
# Compress kernel to a zip file
- name: Create archive
run: |
# Enter the build directory
pushd target/${ARCH_FLAG}-unknown-linux-gnu/${{ matrix.flavor }}
# Compress the kernel to an archive
ARCHIVE="$GITHUB_WORKSPACE/pet-${{ needs.get_version.outputs.PET_VERSION }}-${{ matrix.flavor }}-linux-${{ matrix.arch }}.zip"
[ -e LICENSE ] || cp "$GITHUB_WORKSPACE/LICENSE" LICENSE
zip -Xry $ARCHIVE kcserver LICENSE
popd
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: pet-${{ matrix.flavor }}-linux-${{ matrix.arch }}-archive
path: pet-${{ needs.get_version.outputs.PET_VERSION }}-${{ matrix.flavor }}-linux-${{ matrix.arch }}.zip

create_release:
name: Create Release
runs-on: [self-hosted, macos, arm64]
needs: [do_release, get_version, build_macos, build_windows, build_linux]
needs: [do_release, get_version, build_macos, build_windows]
env:
GITHUB_TOKEN: ${{ github.token }}
outputs:
Expand Down

0 comments on commit 4d72709

Please sign in to comment.