|
| 1 | +name: Release handling |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*.*.*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-release: |
| 10 | + name: "Build release" |
| 11 | + runs-on: windows-latest |
| 12 | + steps: |
| 13 | + - id: get-ver |
| 14 | + run: | |
| 15 | + id=$(echo ${{github.ref_name}} | cut -dv -f2) |
| 16 | + echo "::set-output name=id::$ver" |
| 17 | + - run: echo "${{steps.get-ver.outputs.ver}}" |
| 18 | + |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v2 |
| 21 | + |
| 22 | + - name: Setup MSbuild |
| 23 | + |
| 24 | + |
| 25 | + - name: Setup VSTest Path |
| 26 | + uses: darenm/Setup-VSTest@v1 |
| 27 | + |
| 28 | + - name: Restore nuget packages |
| 29 | + run: msbuild -t:restore |
| 30 | + |
| 31 | + - name: Build |
| 32 | + run: msbuild -t:rebuild -property:Configuration=Release -p:PackageVersion=${{steps.get-ver.outputs.ver}} -p:RepositoryCommit=${{ github.sha }} -p:RepositoryBranch=${{ github.ref_name }} |
| 33 | + |
| 34 | + - name: Test |
| 35 | + run: vstest.console.exe Asap2.Tests\bin\Release\Asap2.Tests.dll |
| 36 | + |
| 37 | + - name: Upload build artifact |
| 38 | + uses: actions/upload-artifact@v2 |
| 39 | + with: |
| 40 | + retention-days: 1 |
| 41 | + name: build_release_${{ github.sha }} |
| 42 | + path: | |
| 43 | + out/* |
| 44 | + README.md |
| 45 | + LICENSE |
| 46 | + if-no-files-found: error |
| 47 | + |
| 48 | + generate-release: |
| 49 | + name: "Generate release" |
| 50 | + needs: build-release |
| 51 | + runs-on: "ubuntu-latest" |
| 52 | + |
| 53 | + steps: |
| 54 | + - name: Setup Nuget |
| 55 | + uses: nuget/setup-nuget@v1 |
| 56 | + with: |
| 57 | + #nuget-api-key: ${{ secrets.NuGetAPIKey }} |
| 58 | + nuget-version: 'latest' |
| 59 | + |
| 60 | + - name: Download build artifact |
| 61 | + uses: actions/download-artifact@v2 |
| 62 | + with: |
| 63 | + name: build_release_${{ github.sha }} |
| 64 | + |
| 65 | + - name: Create release |
| 66 | + uses: "marvinpinto/action-automatic-releases@latest" |
| 67 | + with: |
| 68 | + repo_token: "${{ secrets.GITHUB_TOKEN }}" |
| 69 | + prerelease: false |
| 70 | + files: | |
| 71 | + out/*.nupkg |
| 72 | + README.md |
| 73 | + LICENSE |
0 commit comments