Backwards compatibility #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Package up Prerelease. | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| # runs-on: self-hosted | |
| env: | |
| CONFIG: 'Release' | |
| SOLUTION_FILE: './UmbNav.sln' | |
| OUT_FOLDER: './build.out/' | |
| steps: | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: | | |
| 9.x | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v0.12.0 | |
| with: | |
| versionSpec: '5.x' | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| cache-dependency-path: ./Umbraco.Community.UmbNav/package-lock.json | |
| - run: npm ci | |
| working-directory: ./Umbraco.Community.UmbNav/ | |
| - run: npm run build | |
| working-directory: ./Umbraco.Community.UmbNav/ | |
| - name: Retrieve cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.nuget/packages | |
| key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-nuget-umbcheckout | |
| - name: Determine Version with GitVersion (MSBuild in Proj will do this) | |
| id: gitversion | |
| uses: gittools/actions/gitversion/execute@v0.9.15 | |
| with: | |
| useConfigFile: true | |
| configFilePath: ./GitVersion.yml | |
| - name: Display GitVersion SemVer | |
| run: | | |
| echo "FullSemVer: ${{ steps.gitversion.outputs.nuGetVersionV2 }}" | |
| - name: Update umbraco-package.json version | |
| uses: jossef/action-set-json-field@v2.2 | |
| with: | |
| file: Umbraco.Community.UmbNav/wwwroot/App_Plugins/UmbNav/umbraco-package.json | |
| field: version | |
| value: ${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
| - name: Update package.json version | |
| uses: jossef/action-set-json-field@v2.2 | |
| with: | |
| file: Umbraco.Community.UmbNav/package.json | |
| field: version | |
| value: ${{ steps.gitversion.outputs.semVer }} | |
| # ------------------------ | |
| # actual builds / packages | |
| # ------------------------ | |
| - name: Restore Umbraco.Community.UmbNav | |
| run: dotnet restore ./Umbraco.Community.UmbNav/Umbraco.Community.UmbNav.csproj | |
| - name: Restore Umbraco.Community.UmbNav.Core | |
| run: dotnet restore ./Umbraco.Community.UmbNav.Core/Umbraco.Community.UmbNav.Core.csproj | |
| - name: Build Umbraco.Community.UmbNav | |
| run: dotnet pack ./Umbraco.Community.UmbNav/Umbraco.Community.UmbNav.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.nuGetVersionV2}} | |
| - name: Build Umbraco.Community.UmbNav.Core | |
| run: dotnet pack ./Umbraco.Community.UmbNav.Core/Umbraco.Community.UmbNav.Core.csproj --no-restore -c ${{env.CONFIG}} --output ${{env.OUT_FOLDER}} /p:version=${{steps.gitversion.outputs.nuGetVersionV2}} | |
| - name: Push to GitHub Nuget Repo | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: | | |
| dotnet nuget push ./build.out/Umbraco.Community.UmbNav.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/AaronSadlerUK/index.json --api-key ${{ secrets.GH_PAT }} | |
| dotnet nuget push ./build.out/Umbraco.Community.UmbNav.Core.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://nuget.pkg.github.com/AaronSadlerUK/index.json --api-key ${{ secrets.GH_PAT }} | |
| - name: Push to Nuget Repo | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: | | |
| dotnet nuget push ./build.out/Umbraco.Community.UmbNav.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} | |
| dotnet nuget push ./build.out/Umbraco.Community.UmbNav.Core.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} | |
| - name: Create Release | |
| uses: "softprops/action-gh-release@v2" | |
| with: | |
| name: ${{steps.gitversion.outputs.fullSemVer}} | |
| tag_name: ${{steps.gitversion.outputs.fullSemVer}} | |
| prerelease: true | |
| generate_release_notes: true | |
| files: | | |
| ./build.out/Umbraco.Community.UmbNav.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg | |
| ./build.out/Umbraco.Community.UmbNav.Core.${{steps.gitversion.outputs.nuGetVersionV2}}.nupkg |