-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (148 loc) · 5.15 KB
/
Copy pathrelease-alpha.yml
File metadata and controls
167 lines (148 loc) · 5.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
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