Skip to content

Commit

Permalink
ci: add arm builds (#481)
Browse files Browse the repository at this point in the history
### Why

Turns out we don't need the beta github runners for arm64 builds.
Following
[this](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/cross-compile#linux)
ms doc, mac and windows were already solved. If arm64 runners are
cheaper they should also just work out of the box to compile to x86

Excluding linux here as there were issues getting it setup with
amazonlinux2. We're going to build amazonlinux2 arm64 manually as part
of our testing for a new release for now.

### Ticket

VUL-71
  • Loading branch information
gord5500 committed Sep 24, 2024
1 parent 5c27c17 commit d99c62d
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,21 @@ jobs:
/p:InformationalVersion="$version" `
/p:IncludeSourceRevisionInInformationalVersion=false `
-r $env:PLATFORM-x64 `
-o build
-o build/x64
dotnet publish `
/p:Version="$versionWithoutv" `
/p:InformationalVersion="$version" `
/p:IncludeSourceRevisionInInformationalVersion=false `
-r $env:PLATFORM-arm64 `
-o build/arm64
- name: check size
shell: pwsh
working-directory: src/D2L.Bmx
run: Get-ChildItem build
run: |
Get-ChildItem build/x64
Get-ChildItem build/arm64
- name: upload build
if: github.event_name == 'workflow_dispatch'
Expand All @@ -112,12 +121,30 @@ jobs:
working-directory: src/D2L.Bmx/build
run: |
if ($env:PLATFORM -eq 'win') {
Push-Location "x64"
Compress-Archive -Path "bmx.exe" -DestinationPath "bmx-win-x64.zip"
Pop-Location
Push-Location "arm64"
Compress-Archive -Path "bmx.exe" -DestinationPath "bmx-win-arm64.zip"
Pop-Location
gh release upload "$env:RELEASE_ID" "bmx-win-x64.zip"
gh release upload "$env:RELEASE_ID" "bmx-win-arm64.zip"
} elseif ($env:PLATFORM -eq 'osx') {
chmod +x "bmx"
chmod +x "./x64/bmx"
chmod +x "./arm64/bmx"
Push-Location "x64"
tar -czvf "bmx-osx-x64.tar.gz" "bmx"
Pop-Location
Push-Location "arm64"
tar -czvf "bmx-osx-arm64.tar.gz" "bmx"
Pop-Location
gh release upload "$env:RELEASE_ID" "bmx-osx-x64.tar.gz"
gh release upload "$env:RELEASE_ID" "bmx-osx-arm64.tar.gz"
}
build_docker:
Expand All @@ -128,8 +155,10 @@ jobs:
include:
- file: Dockerfile.al2
platform: linux
architecture: x64
- file: Dockerfile.alpine
platform: linux.alpine
architecture: x64
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down Expand Up @@ -163,13 +192,14 @@ jobs:
shell: bash
env:
RELEASE_ID: ${{ needs.create_release.outputs.release_id }}
ARCHITECTURE: ${{ matrix.architecture }}
PLATFORM: ${{ matrix.platform }}
GH_TOKEN: ${{ github.token }}
working-directory: build
run: |
chmod +x "bmx"
tar -czvf "bmx-$PLATFORM-x64.tar.gz" "bmx"
gh release upload "$RELEASE_ID" "bmx-$PLATFORM-x64.tar.gz"
tar -czvf "bmx-$PLATFORM-$ARCHITECTURE.tar.gz" "bmx"
gh release upload "$RELEASE_ID" "bmx-$PLATFORM-$ARCHITECTURE.tar.gz"
publish_release:
needs: [create_release, build, build_docker]
Expand Down

0 comments on commit d99c62d

Please sign in to comment.