Skip to content

Commit

Permalink
Merge pull request #304 from betwixt-labs/chordc-workflow
Browse files Browse the repository at this point in the history
feat: build workflow
  • Loading branch information
andrewmd5 authored Mar 11, 2024
2 parents aea4815 + 826756b commit e33a04d
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
99 changes: 99 additions & 0 deletions .github/workflows/build-chordc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
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: ./bin/Release/net8.0/${{matrix.IDENTIFIER}}-x64/publish/${{matrix.ARTIFACT}}
CHORD_ARTIFACT_ARM64: ./bin/Release/net8.0/${{matrix.IDENTIFIER}}-arm64/publish/${{matrix.ARTIFACT}}
CHORD_ZIP_ARTIFACT_X86_64: ./bin/Release/net8.0/${{matrix.ARTIFACT}}-${{matrix.IDENTIFIER}}-x64.zip
CHORD_ZIP_ARTIFACT_ARM64: ./bin/Release/net8.0/${{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 apt-get update
sudo apt-get install clang zlib1g-dev libkrb5-dev libtinfo5
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
dotnet-quality: "preview"
- name: Restore Solution
run: dotnet restore

- name: Build chordc
run: |
dotnet publish -c ${{env.CONFIGURATION}} -r ${{matrix.IDENTIFIER}}-x64
dotnet publish -c ${{env.CONFIGURATION}} -r ${{matrix.IDENTIFIER}}-arm64
working-directory: ./Compiler/

- 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: ${{matrix.IDENTIFIER}}-x64
path: ${{env.CHORD_ZIP_ARTIFACT_X86_64}}

- name: Upload chordc ARM64 Build
uses: actions/upload-artifact@v4
with:
name: ${{matrix.IDENTIFIER}}-arm64
path: ${{env.CHORD_ZIP_ARTIFACT_ARM64}}
1 change: 0 additions & 1 deletion extensions/chordc/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Chord.Compiler.Internal.Commands;
using Chord.Compiler.Internal.Utils;
using Chord.Compiler.Shells;
using Chord.Runtime;
using Errata;
using Spectre.Console;

Expand Down
3 changes: 3 additions & 0 deletions extensions/chordc/chordc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<TrimMode>full</TrimMode>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<AssemblyVersion>0.0.0.1</AssemblyVersion>
<Version>0.0.1-alpha</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit e33a04d

Please sign in to comment.