Skip to content

Commit fbf52ed

Browse files
committed
Enhance publish workflow with Java, MSBuild, and versioning
Added JDK 11 and MSBuild setup steps to support cross-platform builds. Introduced MAUI workload installation and dynamic version determination using minver, improving NuGet package versioning and build traceability. Updated job dependencies for deployment.
1 parent 6361255 commit fbf52ed

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
1+
# file: .github/workflows/publish.yml
2+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
23

34
name: publish
45
on:
@@ -43,16 +44,43 @@ jobs:
4344
with:
4445
fetch-depth: 0
4546
show-progress: false
47+
- name: Set up JDK 11
48+
uses: actions/setup-java@v2
49+
with:
50+
java-version: '11'
51+
distribution: 'adopt'
52+
53+
- name: Setup MSBuild path
54+
uses: microsoft/setup-msbuild@v2
55+
with:
56+
vs-version: 'latest'
57+
4658
- name: Setup .NET
4759
uses: actions/setup-dotnet@v5
4860
with:
4961
global-json-file: 'global.json'
50-
- run: dotnet pack src/Plugin.Maui.ML/Plugin.Maui.ML.csproj --configuration Release --output ${{ env.NuGetDirectory }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:MinVerTag=$(git describe --tags)
62+
63+
- name: Install MAUI workloads
64+
run: dotnet workload install maui-android maui-ios maui-maccatalyst
65+
66+
- name: Determine Version
67+
id: minver
68+
run: |
69+
dotnet tool install --global minver-cli
70+
git fetch --tags
71+
git tag
72+
$version = minver --auto-increment minor --build-metadata build --verbosity trace
73+
echo "PACKAGE_VERSION=$version" >> $env:GITHUB_ENV
74+
echo "version=$version" >> $env:GITHUB_OUTPUT
75+
76+
- run: dotnet pack src/Plugin.Maui.ML/Plugin.Maui.ML.csproj --configuration Release --output ${{ env.NuGetDirectory }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:Version=${{ env.PACKAGE_VERSION }}
77+
5178
- name: Prepare Artifacts
5279
run: |
5380
mkdir -p ${{ env.NuGetDirectory }}/artifacts
5481
cp ${{ env.NuGetDirectory }}/*.nupkg ${{ env.NuGetDirectory }}/artifacts
5582
cp ${{ env.NuGetDirectory }}/*.snupkg ${{ env.NuGetDirectory }}/artifacts
83+
5684
- uses: actions/upload-artifact@v4
5785
with:
5886
name: nuget
@@ -83,7 +111,7 @@ jobs:
83111
deploy:
84112
if: github.event_name == 'release'
85113
runs-on: ubuntu-latest
86-
needs: [ run_tests ]
114+
needs: [ create_nuget, run_tests ]
87115
permissions:
88116
id-token: write # enable GitHub OIDC token issuance for this job
89117
steps:

0 commit comments

Comments
 (0)