Skip to content

Commit 3efdf4c

Browse files
Create main.yml (#2)
* Create main.yml * Change to ubuntu * Revert "Change to ubuntu" This reverts commit 010a275. * Fix msbuild * fix * Fix msbuild * Fix * Update
1 parent 53bd561 commit 3efdf4c

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/main.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
build:
18+
# The type of runner that the job will run on
19+
runs-on: windows-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+
- uses: actions/checkout@v2
25+
26+
- name: setup-msbuild
27+
uses: microsoft/setup-msbuild@v1
28+
29+
- name: Get short SHA
30+
id: vars
31+
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
32+
33+
- name: Build project
34+
run: msbuild "MinecraftClient.sln" /t:Build /p:Configuration=Release
35+
36+
- name: Create Release
37+
id: create_release
38+
uses: actions/create-release@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
41+
with:
42+
tag_name: ${{ steps.vars.outputs.sha_short }}
43+
release_name: Release ${{ steps.vars.outputs.sha_short }}
44+
45+
- name: Upload Release Asset
46+
id: upload-release-asset
47+
uses: actions/upload-release-asset@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
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
52+
asset_path: MinecraftClient/bin/Release/MinecraftClient.exe
53+
asset_name: MinecraftClient.exe
54+
asset_content_type: application/vnd.microsoft.portable-executable
55+
56+

0 commit comments

Comments
 (0)