Skip to content

Commit fa1af67

Browse files
authored
Create main.yml #TEST
1 parent 45d981a commit fa1af67

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/main.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: CI
3+
4+
# Controls when the workflow will run
5+
on:
6+
# Triggers the workflow on push or pull request events but only for the master branch
7+
push:
8+
branches: [ dev ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
build:
17+
# The type of runner that the job will run on
18+
runs-on: windows-2019
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
- name: Install 7Zip PowerShell Module
23+
shell: powershell
24+
25+
run: |
26+
# cancel early, if not build commit
27+
$strVal ='${{ github.event.commits[0].message }}'
28+
if($strVal -clike '*#TEST*')
29+
{
30+
Write-Host 'True'
31+
} else {
32+
Write-Host 'False'
33+
exit(1)
34+
}
35+
Install-Module 7Zip4PowerShell -Force -Verbose
36+
- uses: actions/checkout@v2
37+
38+
- name: Restore NuGet packages
39+
run: nuget restore UnityLauncherPro.sln
40+
41+
- name: Build Binary
42+
shell: cmd
43+
run: call .\Build.cmd
44+
45+
- name: Build Artifact
46+
shell: cmd
47+
run: call .\ArtifactBuild.cmd
48+
49+
- name: Create Release
50+
id: create_release
51+
uses: actions/create-release@latest
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
with:
55+
tag_name: ${{github.run_number}}
56+
release_name: Release ${{github.run_number}}
57+
body: |
58+
Automated Release by GitHub Action CI
59+
draft: false
60+
prerelease: false
61+
62+
- name: Upload Release Asset
63+
id: upload-release-asset
64+
uses: actions/upload-release-asset@v1
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
with:
68+
upload_url: ${{ steps.create_release.outputs.upload_url }}
69+
asset_path: ./UnityLauncherPro.ZIP
70+
asset_name: UnityLauncherPro.ZIP
71+
asset_content_type: application/zip

0 commit comments

Comments
 (0)