forked from Fallout-build/Fallout
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (84 loc) · 3.56 KB
/
Copy pathexperimental.yml
File metadata and controls
89 lines (84 loc) · 3.56 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
# Hand-written. The "alpha" channel — `experimental` (ADR-0004, amended 2026-05-30).
#
# Shape:
# - Trigger: push to `experimental`. `experimental` is the fast / AI-assisted
# lane — intentionally unstable, and the only branch where breaking changes
# land (batched to the yearly major). Nerdbank.GitVersioning produces a
# prerelease of the form `2026.1.0-alpha.<height>.g<commit>` (`experimental`
# is NOT a public-release ref in version.json), sorting below `main`'s
# `-preview` and the production `-rc`/GA. Ladder: alpha < preview < rc < GA.
# - Builds + packs, then pushes every *.nupkg to GitHub Packages ONLY.
# - Deliberately does NOT touch nuget.org and does NOT create a GitHub Release.
# GitHub Packages is the test channel and is opt-in for consumers (they add
# the feed), so it causes none of the nuget.org Dependabot fan-out.
#
# The deliberate `-preview` trunk is `main` (preview.yml). Stable + legacy
# releases are deliberate and tag-triggered — see release.yml. Cross-platform
# validation on `experimental` pushes is covered by macos-latest.yml /
# windows-latest.yml; this workflow's job is publishing, not gating.
name: experimental
on:
push:
branches:
- experimental
paths-ignore:
- 'docs/**'
- '.assets/**'
- '**/*.md'
# Cancel a superseded alpha build when a newer commit lands (#322). Never on release.yml.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
experimental:
name: experimental → GitHub Packages
runs-on: ubuntu-latest
permissions:
packages: write
environment:
name: github-packages
url: https://github.com/ChrisonSimtian/Fallout/packages
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Nerdbank.GitVersioning needs full history
- name: 'Cache: .fallout/temp, ~/.nuget/packages'
uses: actions/cache@v4
with:
path: |
.fallout/temp
~/.nuget/packages
key: ${{ runner.os }}-experimental-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props', 'version.json') }}
restore-keys: |
${{ runner.os }}-experimental-
- name: 'Setup: .NET SDK'
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: 'Restore: dotnet tools'
run: dotnet tool restore
# build + unit-test before publishing alpha (#324). One invocation: NUKE runs
# this as discrete internal stages (Restore → Compile → Test → Pack) and fails
# at the breaking stage — separate `dotnet fallout` steps would re-run the
# dependency graph (double-compile), so we keep it a single invocation.
# If Test fails, the job stops here and nothing is published.
- name: 'Run: Test + Pack'
run: dotnet fallout Test Pack
- name: 'Push: all *.nupkg to GitHub Packages (alpha)'
run: |
set -euo pipefail
shopt -s nullglob
packages=(output/packages/*.nupkg)
if [ ${#packages[@]} -eq 0 ]; then
echo "::error::No packages found — nothing to publish to the experimental channel."
exit 1
fi
for pkg in "${packages[@]}"; do
echo "Pushing $pkg to GitHub Packages (alpha)..."
dotnet nuget push "$pkg" \
--source "https://nuget.pkg.github.com/Fallout-build/index.json" \
--api-key "${{ secrets.GITHUB_TOKEN }}" \
--skip-duplicate
done