Refactor workflow for release tag and artifact upload #12
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
| name: Automated Test Build | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - 'master' | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| env: | |
| Solution_Name: WindBot.sln | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup MSBuild.exe | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Restore NuGet packages | |
| run: nuget restore WindBot.sln | |
| - name: Build | |
| run: msbuild $env:Solution_Name /t:Build /p:Configuration=Release | |
| - name: Pack | |
| run: | | |
| mkdir dist | |
| xcopy /e /y bin\Release dist\WindBot\ | |
| xcopy /y BotWrapper\bin\Release\bot.conf dist\ | |
| xcopy /y BotWrapper\bin\Release\bot.exe dist\ | |
| tar -C dist -czvf WindBot.tar.gz * | |
| - name: Upload build artifacts | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: WindBot.tar.gz | |
| - name: GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: salix5/action-automatic-releases@75f1a65738686fd56793b41982fd0ed01cc8e96c | |
| with: | |
| repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
| prerelease: false | |
| files: | | |
| WindBot.tar.gz |