Merge pull request #52 from tgharold/20260328-upgrade-benchmark-depen… #34
Workflow file for this run
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
| # https://github.com/actions/upload-release-asset | |
| # https://github.com/montudor/action-zip | |
| on: | |
| push: | |
| # Sequence of patterns matched against refs/tags | |
| tags: | |
| - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
| name: Create Release on Git Tag | |
| env: | |
| PROJECT: RecursiveDataAnnotationsValidation | |
| CONFIG: Release | |
| TARGET: netstandard2.0 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| # https://stackoverflow.com/a/58178121 | |
| # https://stackoverflow.com/a/59284102 | |
| - name: Get Release Version | |
| run: | | |
| echo "RELEASE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| echo "RELEASE_VERSION=${GITHUB_REF##*/v}" >> $GITHUB_ENV | |
| - name: Print Release Version | |
| run: | | |
| echo "GITHUB_REF=$GITHUB_REF" | |
| echo "RELEASE_TAG=$RELEASE_TAG env.RELEASE_TAG=${{ env.RELEASE_TAG }}" | |
| echo "RELEASE_VERSION=$RELEASE_VERSION env.RELEASE_VERSION=${{ env.RELEASE_VERSION }}" | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 8.0.204 | |
| - name: dotnet build | |
| run: dotnet build --configuration ${{ env.CONFIG }} | |
| - name: dotnet test | |
| run: dotnet test --configuration ${{ env.CONFIG }} | |
| - name: dotnet publish | |
| working-directory: ./src/${{ env.PROJECT }} | |
| run: > | |
| dotnet publish --configuration ${{ env.CONFIG }} | |
| /p:Version="${{ env.RELEASE_VERSION }}" /p:InformationalVersion="${{ env.RELEASE_VERSION }}" | |
| - name: Create artifacts directory | |
| run: mkdir -p artifacts | |
| - name: dotnet pack | |
| run: > | |
| dotnet pack | |
| --configuration ${{ env.CONFIG }} | |
| /p:Version="${{ env.RELEASE_VERSION }}" | |
| --include-symbols | |
| --output artifacts/ | |
| - name: Inspect artifacts directory | |
| run: ls -l artifacts/ | |
| - name: Archive artifacts directory | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.PROJECT }}.artifacts.${{ env.RELEASE_VERSION }} | |
| path: | | |
| artifacts/ | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: false | |
| prerelease: true | |
| - name: Create release directory | |
| run: mkdir -p release | |
| - name: Create Release Zip File | |
| uses: vimtor/action-zip@v1 | |
| with: | |
| files: LICENSE README.md artifacts/ | |
| recursive: true | |
| dest: release/${{ env.PROJECT }}-${{ env.RELEASE_TAG }}.zip | |
| - name: Inspect release directory | |
| run: ls -l release/ | |
| - name: Archive release directory | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ env.PROJECT }}.release.${{ env.RELEASE_TAG }} | |
| path: | | |
| release/ | |
| - name: Attach Zip to GitHub Release | |
| if: ${{ env.RELEASE_CREATE }} | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: release/${{ env.PROJECT }}-${{ env.RELEASE_TAG }}.zip | |
| asset_name: ${{ env.PROJECT }}-${{ env.RELEASE_VERSION }}.zip | |
| asset_content_type: application/zip | |
| - name: Attach .nupkg file to GitHub Release | |
| id: upload-release-asset-nupkg | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: artifacts/${{ env.PROJECT }}.${{ env.RELEASE_VERSION }}.nupkg | |
| asset_name: ${{ env.PROJECT }}.${{ env.RELEASE_VERSION }}.nupkg | |
| asset_content_type: application/zip | |
| - name: Attach .snupkg file to GitHub Release | |
| id: upload-release-asset-snupkg | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: artifacts/${{ env.PROJECT }}.${{ env.RELEASE_VERSION }}.snupkg | |
| asset_name: ${{ env.PROJECT }}.${{ env.RELEASE_VERSION }}.snupkg | |
| asset_content_type: application/zip | |
| - name: Publish on nuget.org | |
| run: > | |
| dotnet nuget push '**/*.nupkg' | |
| -k ${{ secrets.NugetApiKey }} | |
| -s https://api.nuget.org/v3/index.json |