Skip to content

Updated build actions #252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: CI-Build
permissions:
contents: read
defaults:
run:
shell: pwsh

on:
push:
branches:
- develop
- LLVM20

paths-ignore:
- '**.md'
Expand All @@ -12,14 +17,24 @@ on:
pull_request:
branches:
- develop
- LLVM20

paths-ignore:
- '**.md'
- '**.dic'

jobs:
build:
# see: https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#support-fork-repositories-and-dependabot-branches
event_file:
name: "Event File"
runs-on: windows-latest
steps:
- name: Upload event file
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}

build_target:
runs-on: windows-latest
steps:
- name: Checkout Repo
Expand All @@ -31,29 +46,23 @@ jobs:
- name: Build Source
run: ./Build-All.ps1 -ForceClean -BuildMode Source

- name: Publish build logs
if: always() && github.event_name == 'pull_request'
- name: Run Tests
run: ./Invoke-UnitTests.ps1

# Upload test results even if failed; unless cancelled
- name: Upload Test Results
if: (!cancelled())
uses: actions/upload-artifact@v4
with:
name: Build Logs
path: ./BuildOutput/BinLogs
name: Test Results
path: BuildOutput/Test-Results/*.trx

- name: Publish NuGET Packages
- name: Upload NuGET Packages
uses: actions/upload-artifact@v4
with:
name: NuGet Packages
path: ./BuildOutput/NuGet

- name: Run Tests
run: ./Invoke-UnitTests.ps1

- name: Publish test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Logs
path: ./BuildOutput/Test-Results

build-docs:
runs-on: windows-latest
steps:
Expand Down
75 changes: 39 additions & 36 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
name: Release-Build
permissions:
contents: write
pages: write
packages: write
actions: read
defaults:
run:
shell: pwsh

# only comes into play on a PUSH of a tag to the repository
on:
push:
tags:
- 'v*'
- 'v*'

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true

jobs:
release-build:
build_target:
runs-on: windows-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0

- name: Build Source
run: .\Build-All.ps1 -FullInit
run: .\Build-All.ps1 -FullInit -BuildMode Source

- name: Publish Artifacts
- name: Run Tests
run: ./Invoke-UnitTests.ps1

- name: Publish Test Results
uses: actions/upload-artifact@v4
with:
name: NuGet Packages
path: .\BuildOutput\NuGet
name: test-results
path: BuildOutput/Test-Results/*.trx

- name: Run Tests
run: .\Invoke-UnitTests.ps1

- name: Publish test logs
if: always()
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: Test Logs
path: .\BuildOutput\Test-Results
name: nuget-packages
path: .\BuildOutput\Nuget

- name: Show asset names
run: dir BuildOutput/Nuget

- name: Build Docs
run: ./Build-Docs.ps1

- name: Commit Docs
env:
Expand All @@ -45,31 +66,13 @@ jobs:
directory: .\BuildOutput\docs
branch: gh-pages

- name: Publish packages to NuGet.org
run: dotnet nuget push .\BuildOutput\NuGet\*.nupkg -k ${{ secrets.NUGETPUSH_ACCESS_TOKEN }} -s 'https://api.nuget.org/v3/index.json' --skip-duplicate

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: (!cancelled())
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./BuildOutput/Nuget.Packages.zip
asset_name: Nuget.Packages.zip
asset_content_type: application/zip

- name: Publish packages to NuGet.org
env:
NUGET_AUTH_TOKEN: ${{ secrets.nugetpush_access_token }}
DOTNET_CLI_TELEMETRY_OPTOUT: 1
run: |
dir .\BuildOutput\NuGet\*.nupkg | %{dotnet nuget push $_ -k $env:NUGET_AUTH_TOKEN -s 'https://api.nuget.org/v3/index.json' -n true}
43 changes: 43 additions & 0 deletions .github/workflows/test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test Results

on:
workflow_run:
workflows: ["CI-Build"]
types:
- completed
permissions: {}

jobs:
test-results:
name: Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure'

permissions:
checks: write

# needed unless run with comment_mode: off
pull-requests: write

# only needed for private repository
#contents: read
# only needed for private repository
#issues: read

# required by download step to access artifacts API
actions: read

steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.trx"
Loading