diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d44a0b..a04b445 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,6 +78,78 @@ jobs: $errorView = 'DetailedView' .\build.ps1 Pester + cli: + name: ๐Ÿงช Native AOT CLI (${{ matrix.rid }}) + permissions: + contents: read + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04 + rid: linux-x64 + extension: '' + artifact_filename: modulefast-linux-x64.exe + - os: ubuntu-24.04-arm + rid: linux-arm64 + extension: '' + artifact_filename: modulefast-linux-arm64.exe + - os: windows-2025 + rid: win-x64 + extension: .exe + artifact_filename: modulefast-win-x64.exe + - os: windows-11-arm + rid: win-arm64 + extension: .exe + artifact_filename: modulefast-win-arm64.exe + - os: macos-15-intel + rid: osx-x64 + extension: '' + artifact_filename: modulefast-osx-x64 + - os: macos-15 + rid: osx-arm64 + extension: '' + artifact_filename: modulefast-osx-arm64 + runs-on: ${{ matrix.os }} + steps: + - name: ๐Ÿšš Checkout + uses: actions/checkout@v7 + - name: โšก Setup .NET + uses: actions/setup-dotnet@v5 + - name: ๐Ÿ‘ท Publish Native AOT CLI + env: + RID: ${{ matrix.rid }} + run: dotnet publish Source/Console/Console.csproj --configuration Release --runtime $env:RID --self-contained true + - name: ๐Ÿงช Test CLI + env: + RID: ${{ matrix.rid }} + run: | + $publishPath = Join-Path $PWD "Artifacts/publish/Console/release_$env:RID" + $executable = Join-Path $publishPath "modulefast${{ matrix.extension }}" + $output = (& $executable --help) -join "`n" + if ($LASTEXITCODE -ne 0 -or $output -notmatch 'Usage: modulefast') { + throw "CLI help test failed for $env:RID" + } + Write-Output $output + - name: ๐Ÿท๏ธ Rename CLI for artifact + env: + RID: ${{ matrix.rid }} + ARTIFACT_FILENAME: ${{ matrix.artifact_filename }} + run: | + $publishPath = Join-Path $PWD "Artifacts/publish/Console/release_$env:RID" + Move-Item (Join-Path $publishPath "modulefast${{ matrix.extension }}") (Join-Path $publishPath $env:ARTIFACT_FILENAME) + - name: ๐Ÿ“ค Upload CLI + uses: actions/upload-artifact@v7 + with: + name: ModuleFast-${{ matrix.rid }} + path: Artifacts/publish/Console/release_${{ matrix.rid }}/${{ matrix.artifact_filename }} + archive: false + - name: ๐Ÿ“ค Upload zipped CLI + uses: actions/upload-artifact@v7 + with: + name: ModuleFast-${{ matrix.rid }}-zip + path: Artifacts/publish/Console/release_${{ matrix.rid }}/${{ matrix.artifact_filename }} + publish: name: ๐Ÿšข Publish to PowerShell Gallery if: startsWith(github.ref, 'refs/tags/v')