forked from Perfare/AssetStudio
-
Notifications
You must be signed in to change notification settings - Fork 90
85 lines (75 loc) · 3.21 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: AssetStudioBuild
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
createRelease:
description: 'Create a new GitHub Release?'
required: true
default: 'false'
versionName:
description: 'version name'
required: true
default: 'v0.16.48'
jobs:
try_create_release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.try_create_release.outputs.upload_url }}
steps:
- name: Create Release
if: github.event_name == 'workflow_dispatch' && github.event.inputs.createRelease == 'true'
id: try_create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKENFORCI }}
with:
tag_name: ${{ github.event.inputs.versionName }}
release_name: AssetStudio ${{ github.event.inputs.versionName }}
body: Description of the release.
draft: false
prerelease: false
build:
needs: try_create_release
runs-on: windows-latest
strategy:
matrix:
dotnet: ['net472', 'net5.0-windows', 'net6.0-windows']
steps:
- uses: actions/checkout@v2
- uses: microsoft/[email protected]
- name: Download FBX SDK
run: |
md fbx
cd fbx
Invoke-WebRequest "https://damassets.autodesk.net/content/dam/autodesk/www/adn/fbx/2020-2-1/fbx202021_fbxsdk_vs2019_win.exe" -OutFile "fbxsdk.exe"
Start-Process -FilePath "fbxsdk.exe" /S -Wait
Invoke-WebRequest "https://damassets.autodesk.net/content/dam/autodesk/www/adn/fbx/2020-2-1/fbx202021_fbxsdk_vs2019_pdbs.exe" -OutFile "fbxpdb.exe"
Start-Process -FilePath "fbxpdb.exe" /S -Wait
cd ..
- name: Nuget Restore
run: nuget restore
- name: Build ${{ matrix.dotnet }}
run: msbuild /t:AssetStudioGUI:publish /p:Configuration=Release /p:TargetFramework=${{ matrix.dotnet }} /p:SelfContained=false /verbosity:minimal
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: AssetStudio.${{ matrix.dotnet }}
path: AssetStudioGUI/bin/Release/${{ matrix.dotnet }}/publish
- name: Create Zip
if: github.event_name == 'workflow_dispatch' && github.event.inputs.createRelease == 'true'
run: Compress-Archive -Path ./AssetStudioGUI/bin/Release/${{ matrix.dotnet }}/publish/* -DestinationPath ./AssetStudioGUI/bin/Release/${{ matrix.dotnet }}/publish/AssetStudio.${{ matrix.dotnet }}_${{ github.event.inputs.versionName }}.zip
shell: powershell
- name: Upload Release Asset
if: github.event_name == 'workflow_dispatch' && github.event.inputs.createRelease == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOKENFORCI }}
with:
upload_url: ${{ needs.try_create_release.outputs.upload_url }}
asset_path: ./AssetStudioGUI/bin/Release/${{ matrix.dotnet }}/publish/AssetStudio.${{ matrix.dotnet }}_${{ github.event.inputs.versionName }}.zip
asset_name: AssetStudio.${{ matrix.dotnet }}_${{ github.event.inputs.versionName }}.zip
asset_content_type: application/zip