|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: CI |
| 4 | + |
| 5 | +# Controls when the action will run. |
| 6 | +on: |
| 7 | + # Triggers the workflow on push or pull request events but only for the master branch |
| 8 | + push: |
| 9 | + branches: [ master ] |
| 10 | + pull_request: |
| 11 | + branches: [ master ] |
| 12 | + |
| 13 | + # Allows you to run this workflow manually from the Actions tab |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 17 | +jobs: |
| 18 | + # This workflow contains a single job called "build" |
| 19 | + build: |
| 20 | + # The type of runner that the job will run on |
| 21 | + runs-on: windows-latest |
| 22 | + |
| 23 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 24 | + steps: |
| 25 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 26 | + - uses: actions/checkout@v2 |
| 27 | + |
| 28 | + - name: setup-msbuild |
| 29 | + uses: microsoft/setup-msbuild@v1 |
| 30 | + |
| 31 | + - name: Build project |
| 32 | + run: msbuild "MinecraftClient.sln" /t:Build /p:Configuration=Release |
| 33 | + |
| 34 | + - name: Create Release |
| 35 | + id: create_release |
| 36 | + uses: actions/create-release@v1 |
| 37 | + env: |
| 38 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 39 | + with: |
| 40 | + tag_name: ${{ github.ref }} |
| 41 | + release_name: Release ${{ github.ref }} |
| 42 | + |
| 43 | + - name: Upload Release Asset |
| 44 | + id: upload-release-asset |
| 45 | + uses: actions/upload-release-asset@v1 |
| 46 | + with: |
| 47 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 48 | + asset_path: MinecraftClient/bin/Release/MinecraftClient.exe |
| 49 | + asset_name: MinecraftClient.exe |
| 50 | + asset_content_type: application/vnd.microsoft.portable-executable |
| 51 | + |
| 52 | + |
0 commit comments