Release #29
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (1.0.0)' | |
| required: true | |
| type: string | |
| publish: | |
| description: 'Publish Type' | |
| required: true | |
| default: 'publish' | |
| type: choice | |
| options: | |
| - none | |
| - release | |
| - publish | |
| jobs: | |
| build: | |
| name: Build Linux | |
| permissions: | |
| contents: read # To read repository contents | |
| pull-requests: write # To write pull requests analysis results and artifacts | |
| uses: ./.github/workflows/build.yaml | |
| with: | |
| os: ubuntu-latest | |
| version: ${{ inputs.version }} | |
| secrets: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| release: | |
| permissions: | |
| contents: write # To create releases | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup dotnet | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 10.x | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: artifacts-ubuntu-latest | |
| path: artifacts | |
| - name: Clean Artifacts | |
| shell: bash | |
| run: rm -rf artifacts/test | |
| - name: Create release | |
| if: ${{ inputs.publish == 'release' || inputs.publish == 'publish' }} | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: 'artifacts/**/*' | |
| generateReleaseNotes: true | |
| tag: ${{ inputs.version }} | |
| - name: Publish to Nuget | |
| if: ${{ inputs.publish == 'publish' }} | |
| run: > | |
| dotnet | |
| nuget push | |
| artifacts/src/DemaConsulting.SpdxModel/bin/Release/*.nupkg | |
| --source "https://api.nuget.org/v3/index.json" | |
| --api-key "${{ secrets.DEMACONSULTINGNUGETKEY }}" |