Set version to '12.14.1-preview.{height}' #553
This file contains 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: Pack | |
on: | |
push: | |
branches: | |
- \d+\.x | |
tags: | |
- \d+\.\d+\.\d+ | |
workflow_call: | |
secrets: | |
CREATE_RELEASE_PAT: | |
required: true | |
permissions: | |
contents: read | |
id-token: write | |
attestations: write | |
jobs: | |
pack: | |
runs-on: ubuntu-24.04 | |
outputs: | |
semVer2: ${{ steps.nbgv.outputs.SemVer2 }} | |
isPreviewRelease: ${{ startsWith(steps.nbgv.outputs.PrereleaseVersionNoLeadingHyphen, 'preview') }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2 | |
with: | |
fetch-depth: 0 | |
submodules: 'true' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # 4.2.0 | |
with: | |
global-json-file: global.json | |
dotnet-version: | | |
6 | |
7 | |
8 | |
- name: Determine semantic version | |
uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # 0.4.2 | |
id: nbgv | |
- name: Replace NuGet version default value in templates | |
run: find -name template.json -exec sed -i "s/TEMPLATE_GREMLINQ_VERSION_DEFAULT_VALUE/${{ steps.nbgv.outputs.NuGetPackageVersion }}/g" {} \; | |
- name: Build | |
run: dotnet build ./${{ github.event.repository.name }}.sln -c Release -p:ContinuousIntegrationBuild=true | |
- name: Pack | |
run: dotnet pack ./${{ github.event.repository.name }}.sln -c Release --no-build | |
- name: Copy NuGet packages to artifacts | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # 4.4.0 | |
with: | |
name: NuGetPackages | |
path: ./**/${{ github.event.repository.name }}.*.nupkg | |
if-no-files-found: error | |
- run: echo ${{ steps.nbgv.outputs.NuGetPackageVersion }} > Version | |
- name: Output version to artifacts | |
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # 4.4.0 | |
with: | |
name: Version | |
path: Version | |
if-no-files-found: error | |
attest: | |
if: ${{ needs.pack.outputs.isPreviewRelease == 'false' && github.event.repository.visibility == 'public' }} | |
needs: [ pack ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8 | |
with: | |
name: NuGetPackages | |
- name: Attest build provenance | |
uses: actions/attest-build-provenance@v2 | |
with: | |
subject-path: ./**/${{ github.event.repository.name }}.*.nupkg | |
draft-release: | |
needs: [ pack ] | |
runs-on: ubuntu-latest | |
outputs: | |
releaseUploadUrl: ${{ steps.create_release.outputs.upload_url }} | |
releaseUploadId: ${{ steps.create_release.outputs.id }} | |
steps: | |
- name: Draft release | |
id: create_release | |
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # 6.0.0 | |
with: | |
name: ${{ github.event.repository.name }} ${{ needs.pack.outputs.semVer2 }} | |
prerelease: ${{ needs.pack.outputs.isPreviewRelease }} | |
tag: ${{ needs.pack.outputs.semVer2 }} | |
commitish: ${{ github.ref }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.CREATE_RELEASE_PAT }} | |
release: | |
if: ${{ needs.pack.outputs.isPreviewRelease == 'false' }} | |
needs: [ draft-release ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8 | |
with: | |
name: NuGetPackages | |
- uses: shogo82148/actions-upload-release-asset@aac270e08f6b4547ada0b3800f88e1eb3ce9d400 # 1.7.7 | |
with: | |
upload_url: ${{ needs.draft-release.outputs.releaseUploadUrl }} | |
asset_path: '**/${{ github.event.repository.name }}.*.nupkg' | |
github_token: ${{ secrets.CREATE_RELEASE_PAT }} | |
- uses: eregon/publish-release@01df127f5e9a3c26935118e22e738d95b59d10ce # 1.0.6 | |
with: | |
release_id: ${{ needs.draft-release.outputs.releaseUploadId }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.CREATE_RELEASE_PAT }} | |