v2.0.0 #16
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
| # Builds a final release version and pushes to nuget.org | |
| # whenever a release is published. | |
| # Requires: secrets.NUGET_API_KEY | |
| name: publish | |
| on: | |
| release: | |
| types: [prereleased, released] | |
| workflow_dispatch: | |
| inputs: | |
| configuration: | |
| type: choice | |
| description: Configuration | |
| options: | |
| - Release | |
| - Debug | |
| sha: | |
| description: 'Optional commit to deploy (latest if empty)' | |
| version: | |
| description: 'SemVer version to use (0.1.0-preview.[build] if empty)' | |
| env: | |
| DOTNET_NOLOGO: true | |
| Configuration: Release | |
| PackOnBuild: true | |
| GeneratePackageOnBuild: true | |
| VersionLabel: ${{ github.ref }} | |
| VersionOrTag: ${{ github.event.inputs.version || github.event.release.tag_name || format('0.1.0-preview.{0}', github.run_number) }} | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| MSBUILDTERMINALLOGGER: auto | |
| SLEET_FEED_URL: https://api.nuget.org/v3/index.json | |
| jobs: | |
| publish: | |
| runs-on: ${{ vars.PUBLISH_AGENT || 'ubuntu-latest' }} | |
| steps: | |
| - name: 🤘 checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: ⚙ dotnet | |
| uses: devlooped/actions-dotnet-env@v1 | |
| - name: 📝 version | |
| run: echo "Version=${VersionOrTag/v}" >> $GITHUB_ENV | |
| - name: 🙏 build | |
| run: dotnet build -m:1 -bl:build.binlog | |
| - name: 🧪 test | |
| env: | |
| CI_XAI_API_KEY: ${{ secrets.CI_XAI_API_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| shell: pwsh | |
| run: dnx --yes retest -- --no-build | |
| - name: 🐛 logs | |
| uses: actions/upload-artifact@v4 | |
| if: runner.debug && always() | |
| with: | |
| name: logs | |
| path: '*.binlog' | |
| - name: 🚀 nuget | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
| if: ${{ env.NUGET_API_KEY != '' && github.event.action != 'prereleased' }} | |
| working-directory: bin | |
| run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate | |
| - name: 🚀 sleet | |
| env: | |
| SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} | |
| if: env.SLEET_CONNECTION != '' | |
| run: | | |
| dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r) | |
| sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found" |