ci: make required-outcome aggregator non-blocking with warnings #4
Workflow file for this run
This file contains hidden or 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: release-publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Release tag" | |
| required: true | |
| default: "v1.0.0" | |
| enable_win_arm64_native: | |
| description: "Build win-arm64 on native self-hosted runner" | |
| required: false | |
| default: "false" | |
| push: | |
| tags: | |
| - "v*" | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| NPRT_DEV_RESEARCH: "0" | |
| jobs: | |
| build: | |
| name: build-${{ matrix.os }}-${{ matrix.arch }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| arch: x86_64 | |
| suffix: win-x64 | |
| - os: windows-latest | |
| arch: arm64 | |
| suffix: win-arm64-emulated | |
| - os: ubuntu-latest | |
| arch: x86_64 | |
| suffix: linux-x64 | |
| - os: ubuntu-latest | |
| arch: arm64 | |
| suffix: linux-arm64 | |
| - os: macos-latest | |
| arch: x86_64 | |
| suffix: macos-x64 | |
| - os: macos-latest | |
| arch: arm64 | |
| suffix: macos-arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Prepare package directory | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path dist | Out-Null | |
| Copy-Item README.md dist/README.md | |
| if (Test-Path scripts) { Copy-Item scripts dist/scripts -Recurse -Force } | |
| if (Test-Path spec) { Copy-Item spec dist/spec -Recurse -Force } | |
| if (Test-Path src) { Copy-Item src dist/src -Recurse -Force } | |
| - name: Archive package | |
| shell: pwsh | |
| run: | | |
| $out = "nullprt-${{ matrix.suffix }}.zip" | |
| Compress-Archive -Path dist/* -DestinationPath $out -Force | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-${{ matrix.suffix }} | |
| path: nullprt-${{ matrix.suffix }}.zip | |
| build-win-arm64-native: | |
| name: build-windows-arm64-native | |
| if: ${{ vars.NPRT_ENABLE_WIN_ARM64_NATIVE == 'true' || github.event.inputs.enable_win_arm64_native == 'true' }} | |
| runs-on: [self-hosted, Windows, ARM64] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Confirm native architecture | |
| shell: pwsh | |
| run: | | |
| Write-Host "PROCESSOR_ARCHITECTURE=$env:PROCESSOR_ARCHITECTURE" | |
| if ($env:PROCESSOR_ARCHITECTURE -notmatch "ARM64") { | |
| Write-Error "Expected ARM64 native runner." | |
| exit 1 | |
| } | |
| - name: Prepare package directory | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path dist | Out-Null | |
| Copy-Item README.md dist/README.md | |
| if (Test-Path scripts) { Copy-Item scripts dist/scripts -Recurse -Force } | |
| if (Test-Path spec) { Copy-Item spec dist/spec -Recurse -Force } | |
| if (Test-Path src) { Copy-Item src dist/src -Recurse -Force } | |
| - name: Archive package | |
| shell: pwsh | |
| run: | | |
| $out = "nullprt-win-arm64.zip" | |
| Compress-Archive -Path dist/* -DestinationPath $out -Force | |
| - name: Upload native ARM64 artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-win-arm64 | |
| path: nullprt-win-arm64.zip | |
| publish: | |
| name: publish-release | |
| needs: [build, build-win-arm64-native] | |
| if: ${{ always() && needs.build.result == 'success' && (needs.build-win-arm64-native.result == 'success' || needs.build-win-arm64-native.result == 'skipped') }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Resolve tag | |
| id: tag | |
| shell: bash | |
| run: | | |
| if [ -n "${{ github.event.inputs.tag }}" ]; then | |
| echo "value=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare release notes | |
| id: notes | |
| shell: bash | |
| run: | | |
| TAG="${{ steps.tag.outputs.value }}" | |
| if [[ "$TAG" == *"-alpha"* || "$TAG" == *"-beta"* || "$TAG" == *"-rc"* ]]; then | |
| PRERELEASE="true" | |
| else | |
| PRERELEASE="false" | |
| fi | |
| echo "prerelease=$PRERELEASE" >> "$GITHUB_OUTPUT" | |
| cat > RELEASE_NOTES.md <<'EOF' | |
| Nullprt release | |
| - Platform matrix: Windows/Linux/macOS x86_64 + arm64 | |
| - Full production toolchain completion and verification gates | |
| - Community and ecosystem governance assets in repository | |
| - Nightly prerelease upload pipeline and release quality hardening | |
| Quick start: | |
| - Run CI workflows and verification scripts from scripts/ | |
| EOF | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.value }} | |
| name: ${{ steps.tag.outputs.value }} | |
| body_path: RELEASE_NOTES.md | |
| prerelease: ${{ steps.notes.outputs.prerelease == 'true' }} | |
| generate_release_notes: true | |
| files: | | |
| artifacts/**/*.zip |