Merge pull request #351 from betwixt-labs/chord-changes #18
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-chordc | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "extensions/**" | |
branches: | |
- master | |
- vnext | |
pull_request: | |
paths: | |
- "extensions/**" | |
branches: | |
- master | |
- vnext | |
jobs: | |
build-chordc: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-22.04] | |
include: | |
- os: macos-latest | |
IDENTIFIER: osx | |
ARTIFACT: chordc | |
- os: windows-latest | |
IDENTIFIER: win | |
ARTIFACT: chordc.exe | |
- os: ubuntu-22.04 | |
IDENTIFIER: linux | |
ARTIFACT: chordc | |
BUILD_WASI: true | |
env: | |
CONFIGURATION: Release | |
CHORD_ARTIFACT_X86_64: ./extensions/chordc/bin/Release/net8.0/${{matrix.IDENTIFIER}}-x64/publish/${{matrix.ARTIFACT}} | |
CHORD_ARTIFACT_ARM64: ./extensions/chordc/bin/Release/net8.0/${{matrix.IDENTIFIER}}-arm64/publish/${{matrix.ARTIFACT}} | |
CHORD_ZIP_ARTIFACT_X86_64: ./extensions/chordc/bin/Release/net8.0/${{matrix.IDENTIFIER}}-x64/publish/${{matrix.ARTIFACT}}-${{matrix.IDENTIFIER}}-x64.zip | |
CHORD_ZIP_ARTIFACT_ARM64: ./extensions/chordc/bin/Release/net8.0/${{matrix.IDENTIFIER}}-arm64/publish/${{matrix.ARTIFACT}}-${{matrix.IDENTIFIER}}-arm64.zip | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Enviorment Variables | |
id: dotenv | |
uses: falti/[email protected] | |
- if: matrix.os == 'ubuntu-22.04' | |
name: Install Dependencies | |
run: | | |
sudo dpkg --add-architecture arm64 | |
sudo bash -c 'cat > /etc/apt/sources.list.d/arm64.list <<EOF | |
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted | |
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted | |
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse | |
EOF' | |
sudo sed -i -e 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list | |
sudo sed -i -e 's/deb mirror/deb [arch=amd64] mirror/g' /etc/apt/sources.list | |
sudo apt update | |
sudo apt install -y clang llvm binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu zlib1g-dev zlib1g-dev:arm64 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "8.0.x" | |
dotnet-quality: "preview" | |
- name: Restore Solution | |
run: dotnet restore | |
working-directory: ./extensions/chordc | |
- name: Build chordc | |
run: | | |
dotnet publish -c ${{env.CONFIGURATION}} -r ${{matrix.IDENTIFIER}}-x64 | |
dotnet publish -c ${{env.CONFIGURATION}} -r ${{matrix.IDENTIFIER}}-arm64 | |
working-directory: ./extensions/chordc | |
- if: matrix.os == 'macos-latest' | |
name: Zip chordc macOS Binary | |
run: | | |
zip -j ${{env.CHORD_ZIP_ARTIFACT_X86_64}} ${{env.CHORD_ARTIFACT_X86_64}} | |
zip -j ${{env.CHORD_ZIP_ARTIFACT_ARM64}} ${{env.CHORD_ARTIFACT_ARM64}} | |
- if: matrix.os == 'ubuntu-22.04' | |
name: ZIP chordc Linux Build | |
run: | | |
zip -j ${{env.CHORD_ZIP_ARTIFACT_X86_64}} ${{env.CHORD_ARTIFACT_X86_64}} | |
zip -j ${{env.CHORD_ZIP_ARTIFACT_ARM64}} ${{env.CHORD_ARTIFACT_ARM64}} | |
- if: matrix.os == 'windows-latest' | |
name: ZIP chordc Windows Build | |
shell: powershell | |
run: | | |
Compress-Archive -Path ${{env.CHORD_ARTIFACT_X86_64}} -DestinationPath ${{env.CHORD_ZIP_ARTIFACT_X86_64}} | |
Compress-Archive -Path ${{env.CHORD_ARTIFACT_ARM64}} -DestinationPath ${{env.CHORD_ZIP_ARTIFACT_ARM64}} | |
- name: Upload chordc X86_64 Build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chordc-${{matrix.IDENTIFIER}}-x64 | |
path: ${{env.CHORD_ZIP_ARTIFACT_X86_64}} | |
- name: Upload chordc ARM64 Build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: chordc-${{matrix.IDENTIFIER}}-arm64 | |
path: ${{env.CHORD_ZIP_ARTIFACT_ARM64}} |