|
30 | 30 | uses: actions/setup-dotnet@v4.0.0 |
31 | 31 | with: |
32 | 32 | dotnet-version: 9.0.x |
33 | | - - name: Set version |
34 | | - run: | |
35 | | - if ("${{ github.event_name }}" -eq "schedule" -or "${{ inputs.nightly }}" -eq "true") { |
36 | | - # Nightly build - override with specific format |
37 | | - $gitVersion = git describe --tags --abbrev=0 2>$null |
38 | | - if ($gitVersion -match '^v?(\d+\.\d+\.\d+)') { |
39 | | - $baseVersion = $matches[1] |
40 | | - } else { |
41 | | - $baseVersion = "0.32.0" |
42 | | - } |
43 | | - $version = "$baseVersion-octopus-nightly-${{ github.run_number }}" |
44 | | - Write-Host "Setting nightly version to: $version" |
45 | | - "MINVERVERSIONOVERRIDE=$version" >> $env:GITHUB_ENV |
46 | | - } else { |
47 | | - # Regular build - let MinVer calculate from tags/height, just ensure octopus is in default |
48 | | - Write-Host "Using MinVer with default pre-release: octopus.${{ github.run_number }}" |
49 | | - "MINVERDEFAULTPRERELEASEIDENTIFIERS=octopus.${{ github.run_number }}" >> $env:GITHUB_ENV |
50 | | - } |
51 | | - shell: pwsh |
52 | 33 | - name: Build |
53 | 34 | run: dotnet build LibGit2Sharp.sln --configuration Release |
54 | 35 | - name: Show version |
@@ -136,15 +117,23 @@ jobs: |
136 | 117 | nuget-push: |
137 | 118 | name: Octopus NuGet Push |
138 | 119 | needs: [build, test, test-linux] |
139 | | - # && github.ref == 'refs/heads/octopus/master' |
140 | | - if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' && github.event_name != 'schedule' |
| 120 | + if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]' |
141 | 121 | runs-on: ubuntu-22.04 |
142 | 122 | steps: |
143 | 123 | - uses: actions/download-artifact@v4 |
144 | 124 | with: |
145 | 125 | path: staging |
146 | | - - name: Push package to feed 🐙 |
147 | | - id: push-feed |
| 126 | + - name: Push package to feed 🐙 (nightly) |
| 127 | + if: github.event_name == 'schedule' || inputs.nightly |
| 128 | + id: push-feed-nightly |
| 129 | + shell: bash |
| 130 | + env: |
| 131 | + FEED_API_KEY: ${{ secrets.FEED_API_KEY }} |
| 132 | + FEED_SOURCE: ${{ secrets.FEED_SOURCE }} |
| 133 | + run: dotnet nuget push staging/**/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" --skip-duplicate |
| 134 | + - name: Push package to feed 🐙 (regular) |
| 135 | + if: github.event_name != 'schedule' && !inputs.nightly |
| 136 | + id: push-feed-regular |
148 | 137 | shell: bash |
149 | 138 | env: |
150 | 139 | FEED_API_KEY: ${{ secrets.FEED_API_KEY }} |
|
0 commit comments