diff --git a/.github/workflows/pre-integration.yml b/.github/workflows/build.yml similarity index 80% rename from .github/workflows/pre-integration.yml rename to .github/workflows/build.yml index 399317c5f..94172987b 100644 --- a/.github/workflows/pre-integration.yml +++ b/.github/workflows/build.yml @@ -1,11 +1,14 @@ -name: "Pre-Integration" +name: "Build and test" on: + push: + branches: + - main + tags-ignore: + - '**' pull_request: - types: - - opened - - synchronize - - reopened + branches: + - main jobs: dotnet-build: @@ -16,12 +19,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: โš™๏ธ Setup .NET - uses: actions/setup-dotnet@v6 + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: dotnet-version: '10.0.x' @@ -44,17 +47,17 @@ jobs: needs: dotnet-build steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: โš™๏ธ Setup .NET - uses: actions/setup-dotnet@v6 + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: dotnet-version: '10.0.x' - name: โš™๏ธ Setup Node - uses: actions/setup-node@v6 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 with: node-version: '24.x' @@ -76,12 +79,12 @@ jobs: needs: dotnet-test steps: - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v7 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: โš™๏ธ Setup .NET - uses: actions/setup-dotnet@v6 + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 with: dotnet-version: '10.0.x' diff --git a/.github/workflows/post-integration.yml b/.github/workflows/post-integration.yml deleted file mode 100644 index c41e9765d..000000000 --- a/.github/workflows/post-integration.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: "Post-Integration" - -on: - push: - branches: - - main - - '!stable' - - '!release' - -env: - ATC_EMAIL: 'atcnet.org@gmail.com' - ATC_NAME: 'Atc-Net' - NUGET_REPO_URL: 'https://nuget.pkg.github.com/atc-net/index.json' - BRANCH_NAME: ${{ github.ref_name }} - -jobs: - merge-to-stable: - runs-on: ubuntu-latest - steps: - - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v7 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_WORKFLOWS }} - - - name: โš›๏ธ Setup Nerdbank.GitVersioning - uses: dotnet/nbgv@v0.5.2 - with: - setAllVars: true - - - name: โš™๏ธ Setup .NET - uses: actions/setup-dotnet@v6 - with: - dotnet-version: '10.0.x' - - - name: โš™๏ธ Setup Node - uses: actions/setup-node@v6 - with: - node-version: '24.x' - - - name: ๐Ÿงน Clean - run: dotnet clean Atc.Rest.Api.SourceGenerator.slnx -c Release && dotnet nuget locals all --clear - - - name: ๐Ÿ” Restore packages - run: dotnet restore Atc.Rest.Api.SourceGenerator.slnx - - - name: ๐Ÿ› ๏ธ Build solution - run: dotnet build Atc.Rest.Api.SourceGenerator.slnx -c Release --no-restore /p:UseSourceLink=true - - - name: ๐Ÿงช Run unit tests - run: dotnet test --solution Atc.Rest.Api.SourceGenerator.slnx -c Release --no-build --filter-not-trait "Category=Integration" --ignore-exit-code 8 - - - name: โฉ Merge to stable branch - run: | - git config --local user.email ${{ env.ATC_EMAIL }} - git config --local user.name ${{ env.ATC_NAME }} - git checkout stable - git merge --ff-only main - git push origin stable - - - name: ๐Ÿ—ณ๏ธ Creating library package for pre-release - run: | - dotnet pack src/Atc.Rest.Api.SourceGenerator/Atc.Rest.Api.SourceGenerator.csproj \ - -c Release \ - -o ${GITHUB_WORKSPACE}/packages \ - -p:RepositoryBranch=$BRANCH_NAME \ - -p:ContinuousIntegrationBuild=true \ - -p:Version=${NBGV_NuGetPackageVersion} - dotnet pack src/Atc.Rest.Api.Generator.Cli/Atc.Rest.Api.Generator.Cli.csproj \ - -c Release \ - -o ${GITHUB_WORKSPACE}/packages \ - -p:RepositoryBranch=$BRANCH_NAME \ - -p:ContinuousIntegrationBuild=true \ - -p:Version=${NBGV_NuGetPackageVersion} - dotnet pack src/Atc.Rest.Api.Client.Testing/Atc.Rest.Api.Client.Testing.csproj \ - -c Release \ - -o ${GITHUB_WORKSPACE}/packages \ - -p:RepositoryBranch=$BRANCH_NAME \ - -p:ContinuousIntegrationBuild=true \ - -p:Version=${NBGV_NuGetPackageVersion} - - - name: ๐Ÿ“ฆ Push packages to GitHub Package Registry - run: | - dotnet nuget push ${GITHUB_WORKSPACE}/packages/Atc.Rest.Api.SourceGenerator.${NBGV_NuGetPackageVersion}.nupkg \ - -k ${{ secrets.GITHUB_TOKEN }} \ - -s ${{ env.NUGET_REPO_URL }} \ - --skip-duplicate - dotnet nuget push ${GITHUB_WORKSPACE}/packages/atc-rest-api-gen.${NBGV_NuGetPackageVersion}.nupkg \ - -k ${{ secrets.GITHUB_TOKEN }} \ - -s ${{ env.NUGET_REPO_URL }} \ - --skip-duplicate - dotnet nuget push ${GITHUB_WORKSPACE}/packages/Atc.Rest.Api.Client.Testing.${NBGV_NuGetPackageVersion}.nupkg \ - -k ${{ secrets.GITHUB_TOKEN }} \ - -s ${{ env.NUGET_REPO_URL }} \ - --skip-duplicate diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 000000000..c8c42bbe5 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,75 @@ +name: release-please + +on: + push: + branches: + - main + +jobs: + release-please: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write # required for NuGet Trusted Publishing (OIDC) + + steps: + - name: release-please + id: release + uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 + with: + token: ${{ secrets.RELEASE_PLEASE_PAT }} + + - name: ๐Ÿ›’ Checkout repository + if: ${{ steps.release.outputs.release_created }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + ref: ${{ steps.release.outputs.tag_name }} + + - name: โš™๏ธ Setup .NET + if: ${{ steps.release.outputs.release_created }} + uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0 + with: + dotnet-version: '10.0.x' + + - name: ๐Ÿงน Clean + if: ${{ steps.release.outputs.release_created }} + run: dotnet clean Atc.Rest.Api.SourceGenerator.slnx -c Release && dotnet nuget locals all --clear + + - name: ๐Ÿ” Restore packages + if: ${{ steps.release.outputs.release_created }} + run: dotnet restore Atc.Rest.Api.SourceGenerator.slnx + + - name: ๐Ÿ› ๏ธ Build solution + if: ${{ steps.release.outputs.release_created }} + run: dotnet build Atc.Rest.Api.SourceGenerator.slnx -c Release --no-restore /p:UseSourceLink=true + + # The three packages share a single in Directory.Build.props, so they are + # always packed and published together from one release-please tag. + - name: ๐Ÿ—ณ๏ธ Creating library packages for release + if: ${{ steps.release.outputs.release_created }} + run: | + dotnet pack src/Atc.Rest.Api.SourceGenerator/Atc.Rest.Api.SourceGenerator.csproj -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages + dotnet pack src/Atc.Rest.Api.Generator.Cli/Atc.Rest.Api.Generator.Cli.csproj -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages + dotnet pack src/Atc.Rest.Api.Client.Testing/Atc.Rest.Api.Client.Testing.csproj -c Release --no-restore -o ${GITHUB_WORKSPACE}/packages + + - name: ๐Ÿ”‘ NuGet login (OIDC โ†’ short-lived API key) + if: ${{ steps.release.outputs.release_created }} + id: nuget-login + uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 + with: + user: ${{ secrets.NUGET_USER }} + + - name: ๐Ÿ“ฆ Push packages to NuGet + if: ${{ steps.release.outputs.release_created }} + run: | + dotnet nuget push ${GITHUB_WORKSPACE}/packages/Atc.Rest.Api.SourceGenerator.*.nupkg -k "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols + dotnet nuget push ${GITHUB_WORKSPACE}/packages/atc-rest-api-gen.*.nupkg -k "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols + dotnet nuget push ${GITHUB_WORKSPACE}/packages/Atc.Rest.Api.Client.Testing.*.nupkg -k "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols + + - name: ๐ŸŒฉ๏ธ ATC-API invalidate cache for CLI-Tool + if: ${{ steps.release.outputs.release_created }} + uses: satak/webrequest-action@3697cc0c0ba0d501729b080ab5825c04bf96132e # v1.5.0 + with: + url: https://atcnet-api-prod-api-ca-01.greenhill-862ffb7c.swedencentral.azurecontainerapps.io/nuget-search/package?packageId=atc-rest-api-gen&invalidateCache=true + method: GET diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 28b809c1d..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: "Release" - -on: - workflow_dispatch: - -env: - ATC_EMAIL: 'atcnet.org@gmail.com' - ATC_NAME: 'Atc-Net' - NUGET_REPO_URL: 'https://api.nuget.org/v3/index.json' - BRANCH_NAME: ${{ github.ref_name }} - -jobs: - release: - if: github.ref == 'refs/heads/stable' - runs-on: ubuntu-latest - steps: - - name: ๐Ÿ›’ Checkout repository - uses: actions/checkout@v7 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_WORKFLOWS }} - - - name: โš›๏ธ Setup Nerdbank.GitVersioning - uses: dotnet/nbgv@v0.5.2 - with: - setAllVars: true - - - name: โš™๏ธ Setup .NET - uses: actions/setup-dotnet@v6 - with: - dotnet-version: '10.0.x' - - - name: ๐Ÿงน Clean - run: dotnet clean Atc.Rest.Api.SourceGenerator.slnx -c Release && dotnet nuget locals all --clear - - - name: ๐Ÿ” Restore packages - run: dotnet restore Atc.Rest.Api.SourceGenerator.slnx - - - name: ๐Ÿ› ๏ธ Build solution - run: dotnet build Atc.Rest.Api.SourceGenerator.slnx -c Release --no-restore /p:UseSourceLink=true - - - name: โฉ Merge to release branch - run: | - git config --local user.email ${{ env.ATC_EMAIL }} - git config --local user.name ${{ env.ATC_NAME }} - git checkout release - git merge --ff-only stable - git push origin release - - - name: ๐Ÿ—ณ๏ธ Creating library package for release - run: | - dotnet pack src/Atc.Rest.Api.SourceGenerator/Atc.Rest.Api.SourceGenerator.csproj \ - -c Release \ - --no-restore \ - -o ${GITHUB_WORKSPACE}/packages \ - -p:RepositoryBranch=$BRANCH_NAME \ - /p:PublicRelease=true - dotnet pack src/Atc.Rest.Api.Generator.Cli/Atc.Rest.Api.Generator.Cli.csproj \ - -c Release \ - --no-restore \ - -o ${GITHUB_WORKSPACE}/packages \ - -p:RepositoryBranch=$BRANCH_NAME \ - /p:PublicRelease=true - dotnet pack src/Atc.Rest.Api.Client.Testing/Atc.Rest.Api.Client.Testing.csproj \ - -c Release \ - --no-restore \ - -o ${GITHUB_WORKSPACE}/packages \ - -p:RepositoryBranch=$BRANCH_NAME \ - /p:PublicRelease=true - - - name: ๐Ÿ“ฆ Push packages to NuGet - run: | - dotnet nuget push ${GITHUB_WORKSPACE}/packages/Atc.Rest.Api.SourceGenerator.*.nupkg \ - -k ${{ secrets.NUGET_KEY }} \ - -s ${{ env.NUGET_REPO_URL }} \ - --skip-duplicate \ - --no-symbols - dotnet nuget push ${GITHUB_WORKSPACE}/packages/atc-rest-api-gen.*.nupkg \ - -k ${{ secrets.NUGET_KEY }} \ - -s ${{ env.NUGET_REPO_URL }} \ - --skip-duplicate \ - --no-symbols - dotnet nuget push ${GITHUB_WORKSPACE}/packages/Atc.Rest.Api.Client.Testing.*.nupkg \ - -k ${{ secrets.NUGET_KEY }} \ - -s ${{ env.NUGET_REPO_URL }} \ - --skip-duplicate \ - --no-symbols - - - name: ๐ŸŒฉ๏ธ ATC-API invalidate cache for CLI-Tool - run: | - curl --fail --silent --show-error --location --retry 3 --max-time 60 \ - 'https://atcnet-api-prod-api-ca-01.greenhill-862ffb7c.swedencentral.azurecontainerapps.io/nuget-search/package?packageId=atc-rest-api-gen&invalidateCache=true' diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..2fbcfc74c --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.392" +} diff --git a/Directory.Build.props b/Directory.Build.props index 1db7a787a..f0b3a6c36 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -18,6 +18,13 @@ en-US + + + + 1.0.392 + + + enable 14.0 diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..bbc4933f8 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "simple", + "bootstrap-sha": "854d91444e5bed870749c770a6fae287afd2ab71", + "pull-request-title-pattern": "chore: release version ${version}", + "pull-request-header": ":robot: Preparing to release next version", + "pull-request-footer": "This pull request was generated by release-please.", + "packages": { + ".": { + "extra-files": [ + "Directory.Build.props" + ] + } + }, + "changelog-sections": [ + { + "type": "feat", + "section": "New features" + }, + { + "type": "fix", + "scope": "deps", + "section": "Upgrades" + }, + { + "type": "fix", + "section": "Bug fixes" + }, + { + "type": "perf", + "section": "Performance improvements" + }, + { + "type": "revert", + "section": "Reverts" + } + ] +} diff --git a/sample/Directory.Build.props b/sample/Directory.Build.props index 509ec8b47..bf64cf642 100644 --- a/sample/Directory.Build.props +++ b/sample/Directory.Build.props @@ -8,6 +8,10 @@ + + false + + false - - true