Skip to content

Commit ed1784c

Browse files
committed
Update
1 parent f50fca4 commit ed1784c

File tree

58 files changed

+11347
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+11347
-399
lines changed

.github/workflows/build.yml

Lines changed: 138 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,153 @@
1-
name: CI
1+
name: Build
22

33
on:
44
push:
55
branches:
6-
- master
7-
- release/*
6+
- master
7+
- main
8+
- develop
9+
- 'feature/**'
10+
- 'release/**'
811
pull_request:
912
branches:
10-
- master
13+
- master
14+
- main
15+
- develop
16+
17+
env:
18+
DOTNET_NOLOGO: true
19+
DOTNET_CLI_TELEMETRY_OPTOUT: true
20+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
1121

1222
jobs:
1323
build:
24+
name: Build (${{ matrix.os }})
25+
runs-on: ${{ matrix.os }}
1426
strategy:
27+
fail-fast: false
1528
matrix:
1629
os: [ubuntu-latest, windows-latest, macos-latest]
17-
name: Build ${{ matrix.os }}
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
submodules: recursive
36+
37+
- name: Setup .NET
38+
uses: actions/setup-dotnet@v4
39+
with:
40+
global-json-file: global.json
41+
42+
- name: Determine version suffix
43+
shell: bash
44+
run: |
45+
if [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
46+
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
47+
else
48+
echo "VERSION_SUFFIX=-build.${{ github.run_number }}" >> $GITHUB_ENV
49+
fi
50+
51+
- name: Restore
52+
run: dotnet restore
53+
54+
- name: Build
55+
run: dotnet build -c Release --no-restore -p:VersionSuffix="${{ env.VERSION_SUFFIX }}"
56+
57+
test:
58+
name: Test (${{ matrix.os }})
1859
runs-on: ${{ matrix.os }}
60+
needs: build
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
os: [ubuntu-latest, windows-latest, macos-latest]
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
with:
69+
submodules: recursive
70+
71+
- name: Setup .NET
72+
uses: actions/setup-dotnet@v4
73+
with:
74+
global-json-file: global.json
1975

76+
- name: Determine version suffix
77+
shell: bash
78+
run: |
79+
if [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
80+
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
81+
else
82+
echo "VERSION_SUFFIX=-build.${{ github.run_number }}" >> $GITHUB_ENV
83+
fi
84+
85+
- name: Restore
86+
run: dotnet restore
87+
88+
- name: Build
89+
run: dotnet build -c Release --no-restore -p:VersionSuffix="${{ env.VERSION_SUFFIX }}"
90+
91+
- name: Test
92+
run: dotnet test -c Release --no-build --logger trx --results-directory artifacts/test
93+
94+
- name: Upload test results
95+
uses: actions/upload-artifact@v4
96+
if: always()
97+
with:
98+
name: test-results-${{ matrix.os }}
99+
path: artifacts/test/**/*.trx
100+
if-no-files-found: error
101+
retention-days: 7
102+
103+
- name: Publish test results
104+
uses: dorny/test-reporter@v1
105+
if: always()
106+
with:
107+
name: Test Results (${{ matrix.os }})
108+
path: artifacts/test/**/*.trx
109+
reporter: dotnet-trx
110+
fail-on-empty: false
111+
112+
pack:
113+
name: Pack (ubuntu-latest)
114+
runs-on: ubuntu-latest
115+
needs: [build, test]
20116
steps:
21-
- uses: actions/checkout@v1
22-
- name: Setup .NET Core SDK
23-
uses: actions/setup-dotnet@v1.9.0
24-
- name: Install wasm-tools
25-
run: dotnet workload install wasm-tools wasm-experimental
26-
- name: Build Release
27-
run: dotnet build --configuration Release
28-
- name: Test Release
29-
run: dotnet test --configuration Release
117+
- name: Checkout
118+
uses: actions/checkout@v4
119+
with:
120+
submodules: recursive
121+
122+
- name: Setup .NET
123+
uses: actions/setup-dotnet@v4
124+
with:
125+
global-json-file: global.json
126+
127+
- name: Determine version suffix
128+
shell: bash
129+
run: |
130+
if [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
131+
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
132+
else
133+
echo "VERSION_SUFFIX=-build.${{ github.run_number }}" >> $GITHUB_ENV
134+
fi
135+
136+
- name: Restore
137+
run: dotnet restore
138+
139+
- name: Build
140+
run: dotnet build -c Release --no-restore -p:VersionSuffix="${{ env.VERSION_SUFFIX }}"
141+
142+
- name: Pack
143+
run: dotnet pack -c Release --no-build -p:VersionSuffix="${{ env.VERSION_SUFFIX }}" -o artifacts/packages
144+
145+
- name: Upload NuGet packages
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: nuget-packages-ubuntu-latest
149+
path: |
150+
artifacts/packages/*.nupkg
151+
artifacts/packages/*.snupkg
152+
if-no-files-found: error
153+
retention-days: 30

.github/workflows/release.yml

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to release (e.g., 11.3.9)'
11+
required: true
12+
type: string
13+
prerelease:
14+
description: 'Is this a pre-release?'
15+
required: false
16+
type: boolean
17+
default: false
18+
19+
env:
20+
DOTNET_NOLOGO: true
21+
DOTNET_CLI_TELEMETRY_OPTOUT: true
22+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
23+
24+
jobs:
25+
build:
26+
name: Build Release
27+
runs-on: ubuntu-latest
28+
outputs:
29+
version: ${{ steps.version.outputs.version }}
30+
is-prerelease: ${{ steps.version.outputs.is-prerelease }}
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
submodules: recursive
37+
38+
- name: Setup .NET
39+
uses: actions/setup-dotnet@v4
40+
with:
41+
global-json-file: global.json
42+
43+
- name: Determine version
44+
id: version
45+
run: |
46+
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
47+
VERSION="${{ github.event.inputs.version }}"
48+
IS_PRERELEASE="${{ github.event.inputs.prerelease }}"
49+
else
50+
# Extract version from tag (e.g., v11.3.9 -> 11.3.9)
51+
VERSION="${GITHUB_REF#refs/tags/v}"
52+
# Check if it's a prerelease (contains -, e.g., 11.3.9-preview1)
53+
if [[ "$VERSION" == *"-"* ]]; then
54+
IS_PRERELEASE="true"
55+
else
56+
IS_PRERELEASE="false"
57+
fi
58+
fi
59+
echo "version=$VERSION" >> $GITHUB_OUTPUT
60+
echo "is-prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
61+
echo "Building version: $VERSION (prerelease: $IS_PRERELEASE)"
62+
63+
- name: Restore
64+
run: dotnet restore
65+
66+
- name: Build
67+
run: dotnet build -c Release --no-restore
68+
69+
test:
70+
name: Test Release
71+
runs-on: ubuntu-latest
72+
needs: build
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
with:
77+
submodules: recursive
78+
79+
- name: Setup .NET
80+
uses: actions/setup-dotnet@v4
81+
with:
82+
global-json-file: global.json
83+
84+
- name: Restore
85+
run: dotnet restore
86+
87+
- name: Build
88+
run: dotnet build -c Release --no-restore
89+
90+
- name: Test
91+
run: dotnet test -c Release --no-build --logger trx --results-directory artifacts/test
92+
93+
- name: Upload test results
94+
uses: actions/upload-artifact@v4
95+
if: always()
96+
with:
97+
name: release-test-results
98+
path: artifacts/test/**/*.trx
99+
if-no-files-found: error
100+
retention-days: 7
101+
102+
- name: Publish test results
103+
uses: dorny/test-reporter@v1
104+
if: always()
105+
with:
106+
name: Release Test Results
107+
path: artifacts/test/**/*.trx
108+
reporter: dotnet-trx
109+
fail-on-empty: false
110+
111+
pack:
112+
name: Pack Release
113+
runs-on: ubuntu-latest
114+
needs: [build, test]
115+
steps:
116+
- name: Checkout
117+
uses: actions/checkout@v4
118+
with:
119+
submodules: recursive
120+
121+
- name: Setup .NET
122+
uses: actions/setup-dotnet@v4
123+
with:
124+
global-json-file: global.json
125+
126+
- name: Restore
127+
run: dotnet restore
128+
129+
- name: Build
130+
run: dotnet build -c Release --no-restore
131+
132+
- name: Pack
133+
run: dotnet pack -c Release --no-build -o artifacts/packages
134+
135+
- name: Upload NuGet packages
136+
uses: actions/upload-artifact@v4
137+
with:
138+
name: release-nuget-packages
139+
path: |
140+
artifacts/packages/*.nupkg
141+
artifacts/packages/*.snupkg
142+
if-no-files-found: error
143+
retention-days: 90
144+
145+
publish-nuget:
146+
name: Publish to NuGet
147+
runs-on: ubuntu-latest
148+
needs: [build, pack]
149+
environment: nuget
150+
steps:
151+
- name: Download NuGet packages
152+
uses: actions/download-artifact@v4
153+
with:
154+
name: release-nuget-packages
155+
path: packages
156+
157+
- name: Setup .NET
158+
uses: actions/setup-dotnet@v4
159+
with:
160+
dotnet-version: '10.0.x'
161+
162+
- name: Publish to NuGet
163+
run: |
164+
shopt -s nullglob
165+
for package in packages/*.nupkg packages/*.snupkg; do
166+
echo "Publishing $package..."
167+
dotnet nuget push "$package" \
168+
--api-key ${{ secrets.NUGET_API_KEY }} \
169+
--source https://api.nuget.org/v3/index.json \
170+
--skip-duplicate
171+
done
172+
173+
create-release:
174+
name: Create GitHub Release
175+
runs-on: ubuntu-latest
176+
needs: [build, pack, publish-nuget]
177+
permissions:
178+
contents: write
179+
steps:
180+
- name: Checkout
181+
uses: actions/checkout@v4
182+
with:
183+
submodules: recursive
184+
185+
- name: Download NuGet packages
186+
uses: actions/download-artifact@v4
187+
with:
188+
name: release-nuget-packages
189+
path: packages
190+
191+
- name: Create GitHub Release
192+
uses: softprops/action-gh-release@v1
193+
with:
194+
name: PanAndZoom v${{ needs.build.outputs.version }}
195+
tag_name: ${{ github.ref_name }}
196+
draft: false
197+
prerelease: ${{ needs.build.outputs.is-prerelease == 'true' }}
198+
generate_release_notes: true
199+
files: |
200+
packages/*.nupkg
201+
packages/*.snupkg
202+
env:
203+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)