|
| 1 | +name: Nightly Build |
| 2 | + |
| 3 | +env: |
| 4 | + PACKAGE_ID: ExceptionalDevs.Exceptional.Nightly |
| 5 | + PACKAGE_TITLE: Exceptional for ReSharper (Nightly) |
| 6 | + |
| 7 | +on: |
| 8 | + repository_dispatch: |
| 9 | + push: |
| 10 | + types: build-nightly |
| 11 | + schedule: |
| 12 | + - cron: '30 1 * * *' |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: Nightly Build |
| 17 | + runs-on: windows-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v1 |
| 20 | + with: |
| 21 | + ref: 'master' |
| 22 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 23 | + |
| 24 | + - name: Checkout master |
| 25 | + if: success() |
| 26 | + run: git checkout master |
| 27 | + |
| 28 | + - name: Precondition |
| 29 | + if: success() |
| 30 | + run: .\build\precondition.ps1 |
| 31 | + |
| 32 | + - name: Setup Environment Variables |
| 33 | + run: | |
| 34 | + $CurrentVersion = .\build\get-version.ps1 |
| 35 | + $NupkgFileName = "${env:PACKAGE_ID}.${CurrentVersion}.nupkg" |
| 36 | + $NupkgFile = ".\build\packages\${NupkgFileName}" |
| 37 | + $TagName = "v${CurrentVersion}_nightly" |
| 38 | + echo "::set-env name=VERSION::$CurrentVersion" |
| 39 | + echo "::set-env name=NUPKG_FILE_NAME::$NupkgFileName" |
| 40 | + echo "::set-env name=NUPKG_FILE::$NupkgFile" |
| 41 | + echo "::set-env name=TAG_NAME::$TagName" |
| 42 | + |
| 43 | + - name: Setup MSBuild |
| 44 | + uses: warrenbuckley/Setup-MSBuild@v1 |
| 45 | + |
| 46 | + - name: Setup Nuget |
| 47 | + uses: warrenbuckley/Setup-Nuget@v1 |
| 48 | + |
| 49 | + - name: Build |
| 50 | + if: success() |
| 51 | + run: | |
| 52 | + nuget restore ./src/Exceptional.sln |
| 53 | + msbuild ./src/Exceptional.sln /p:Configuration=Release /t:rebuild |
| 54 | +
|
| 55 | + - name: Pack |
| 56 | + if: success() |
| 57 | + run: nuget pack .\build\ExceptionalDevs.Exceptional.nuspec -OutputDirectory .\build\packages -properties "PackageId=${env:PACKAGE_ID};PackageTitle=${env:PACKAGE_TITLE}" |
| 58 | + |
| 59 | + - name: Release |
| 60 | + id: create_release |
| 61 | + if: success() |
| 62 | + uses: actions/create-release@v1 |
| 63 | + with: |
| 64 | + tag_name: ${{ env.TAG_NAME }} |
| 65 | + release_name: "Nightly Build (${{ env.VERSION }})" |
| 66 | + draft: false |
| 67 | + prerelease: true |
| 68 | + env: |
| 69 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + |
| 71 | + - name: Upload Release Asset |
| 72 | + |
| 73 | + with: |
| 74 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 75 | + asset_path: ${{ env.NUPKG_FILE }} |
| 76 | + asset_name: ${{ env.NUPKG_FILE_NAME }} |
| 77 | + asset_content_type: application/octet-stream |
| 78 | + env: |
| 79 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 80 | + |
| 81 | + - name: Update nightly.rev |
| 82 | + if: success() |
| 83 | + run: .\build\update-nightly-rev.ps1 |
| 84 | + |
| 85 | + - name: Increment Version |
| 86 | + if: success() |
| 87 | + run: .\build\increment-version.ps1 0.0.0.1 |
| 88 | + |
| 89 | + - name: Add & Commit |
| 90 | + if: success() |
| 91 | + run: | |
| 92 | + git config user.email [email protected] |
| 93 | + git config user.name "GitHub Actions" |
| 94 | + git commit -a -m "Nightly Commit" --author="GitHub Actions<[email protected]>" |
| 95 | + git status |
| 96 | +
|
| 97 | + - name: Git Push |
| 98 | + if: success() |
| 99 | + uses: ad-m/github-push-action@master |
| 100 | + with: |
| 101 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 102 | + |
| 103 | + |
0 commit comments