forked from Simoyd/BoundlessProxyUi
-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (103 loc) · 4.68 KB
/
release.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# This is a basic workflow to help you get started with Actions
name: BoundlexxProxyUI Create Release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
tags: ["1.*"]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Build
# The type of runner that the job will run on
runs-on: windows-latest
env:
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.com
SLN_PATH: BoundlessProxyUi.sln
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
uses: NuGet/setup-nuget@v1
- name: Disable Out of Proc Build
shell: cmd
run: DisableOutOfProcBuild.exe
working-directory: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild
- name: Devenv Update Config
shell: cmd
run: |
"%MSBUILD_PATH%" /updateconfiguration
- name: Restore NuGet Packages
shell: cmd
run: nuget restore "%SLN_PATH%"
- name: Build BoundlessProxyUi Main
shell: cmd
run: |
cd ${{ github.workspace }}
"%MSBUILD_PATH%" "%SLN_PATH%" /Build release /Project BoundlessProxyUi
- name: Build BoundlessProxyUi Installer
shell: cmd
run: |
cd ${{ github.workspace }}
"%MSBUILD_PATH%" "%SLN_PATH%" /Build release /Project BoundlessProxyUi /Project BoundlessProxyUI_Installer
- name: Delete extra files
run: |
cd .\BoundlessProxyUi\bin\x64\Release\
Remove-Item -Force -Recurse .\fr-CA -erroraction 'silentlycontinue'
Remove-Item -Force -Recurse .\pl-PL -erroraction 'silentlycontinue'
Remove-Item -Force -Recurse .\pt-BR -erroraction 'silentlycontinue'
Remove-Item -Force -Recurse .\ru-RU -erroraction 'silentlycontinue'
Remove-Item -Force -Recurse .\zh-CN -erroraction 'silentlycontinue'
Remove-Item -Force .\BoundlessProxyUi.application -erroraction 'silentlycontinue'
Remove-Item -Force .\BoundlessProxyUi.exe.config -erroraction 'silentlycontinue'
Remove-Item -Force -Filter *.xml .\* -erroraction 'silentlycontinue'
Remove-Item -Force -Filter *.pdb .\* -erroraction 'silentlycontinue'
cd ${{ github.workspace }}
- name: Zip Portable
run: |
cd .\BoundlessProxyUi\bin\x64\Release\
tar.exe -a -c -f ${{ github.workspace }}\BoundlessProxyUi_Portable.zip *
cd ${{ github.workspace }}
- name: Upload Portable Artifact
uses: actions/upload-artifact@v2
with:
name: BoundlessProxyUi Portable
path: ${{ github.workspace }}\BoundlessProxyUi\bin\x64\Release\
- name: Upload Installer Artifact
uses: actions/upload-artifact@v2
with:
name: BoundlessProxyUI Installer
path: ${{ github.workspace }}\BoundlessProxyUI_Installer\Release\BoundlessProxyUI_Installer.msi
- name: Create Release
uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
console.log('environment', process.versions);
const fs = require('fs').promises;
const { repo: { owner, repo }, sha } = context;
console.log({ owner, repo, sha });
const release = await github.repos.createRelease({
owner, repo,
tag_name: process.env.GITHUB_REF,
draft: true,
target_commitish: sha,
body: 'Actions Build: https://github.com/' + process.env.GITHUB_REPOSITORY + '/actions/runs/' + process.env.GITHUB_RUN_ID
});
console.log('created release', { release });
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: release.data.id,
name: 'BoundlessProxyUi_Portable.zip',
data: await fs.readFile(`./BoundlessProxyUi_Portable.zip`)
});
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: release.data.id,
name: 'BoundlessProxyUI_Installer.msi',
data: await fs.readFile(`./BoundlessProxyUI_Installer/Release/BoundlessProxyUI_Installer.msi`)
});