|
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 |
2 | 3 |
|
3 | 4 | name: publish |
4 | 5 | on: |
@@ -43,16 +44,43 @@ jobs: |
43 | 44 | with: |
44 | 45 | fetch-depth: 0 |
45 | 46 | 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 | + |
46 | 58 | - name: Setup .NET |
47 | 59 | uses: actions/setup-dotnet@v5 |
48 | 60 | with: |
49 | 61 | 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 | + |
51 | 78 | - name: Prepare Artifacts |
52 | 79 | run: | |
53 | 80 | mkdir -p ${{ env.NuGetDirectory }}/artifacts |
54 | 81 | cp ${{ env.NuGetDirectory }}/*.nupkg ${{ env.NuGetDirectory }}/artifacts |
55 | 82 | cp ${{ env.NuGetDirectory }}/*.snupkg ${{ env.NuGetDirectory }}/artifacts |
| 83 | + |
56 | 84 | - uses: actions/upload-artifact@v4 |
57 | 85 | with: |
58 | 86 | name: nuget |
|
83 | 111 | deploy: |
84 | 112 | if: github.event_name == 'release' |
85 | 113 | runs-on: ubuntu-latest |
86 | | - needs: [ run_tests ] |
| 114 | + needs: [ create_nuget, run_tests ] |
87 | 115 | permissions: |
88 | 116 | id-token: write # enable GitHub OIDC token issuance for this job |
89 | 117 | steps: |
|
0 commit comments