forked from goatcorp/FFXIVQuickLauncher
-
Notifications
You must be signed in to change notification settings - Fork 20
/
ci-workflow.yml
116 lines (111 loc) · 4.79 KB
/
ci-workflow.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
name: Build XIVLauncher
on: [push, pull_request]
concurrency: build_xl
jobs:
build-release:
name: Build Release on Windows
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-2022
steps:
# - uses: nadock/verified_commits_check@f9b330e987c2e7121dfc0230e65cb5751ee5fac9
- uses: actions/checkout@v1
- name: Initialize Submodules
run: git submodule update --init --recursive
- name: Restore Nuget Packages
run: |
cd .\src\
dotnet restore
cd ..
- name: Define VERSION
run: |
$env:COMMIT = $env:GITHUB_SHA.Substring(0, 7)
$env:REPO_NAME = $env:GITHUB_REPOSITORY -replace '.*/'
$env:BRANCH = $env:GITHUB_REF -replace '.*/'
($env:REPO_NAME) >> VERSION
($env:BRANCH) >> VERSION
($env:COMMIT) >> VERSION
- name: Build DotNet4 for Release
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe $Env:GITHUB_WORKSPACE\src\XIVLauncher.sln /t:Build /p:Configuration=Release
- name: Build Squirrel Release
id: build-squirrel
run: |
cd src\
$releases = Invoke-WebRequest -Uri 'https://api.github.com/repos/ottercorp/FFXIVQuickLauncher/releases'
$current = ConvertFrom-Json -InputObject $releases.Content | Select-Object -First 1
$refver = $env:GITHUB_REF -replace '.*/'
echo "::set-output name=version::$refver"
nuget pack .\XIVLauncher.nuspec -properties version=$refver
mkdir Releases
cp .\XIVLauncher\Resources\CHANGELOG.txt .\Releases\
$release_file = $current.assets | Where-Object -Property name -Value RELEASES -EQ
Invoke-WebRequest -Uri $release_file.browser_download_url -OutFile .\Releases\RELEASES
$delta_file = $current.assets | Where-Object -Property name -Value "*delta.nupkg" -Like
try
{
Invoke-WebRequest -Uri $delta_file.browser_download_url -OutFile ".\Releases\$($delta_file.name)"
}
catch
{
}
$full_file = $current.assets | Where-Object -Property name -Value "*full.nupkg" -Like
Invoke-WebRequest -Uri $full_file.browser_download_url -OutFile ".\Releases\$($full_file.name)"
$setup_file = $current.assets | Where-Object -Property name -Value "Setup.exe" -EQ
Invoke-WebRequest -Uri $setup_file.browser_download_url -OutFile .\Releases\Setup.exe
Copy-Item -Path $Env:GITHUB_WORKSPACE\misc\packer\Setup.exe -Destination ~\.nuget\packages\squirrel.windows\1.9.1\tools\ -Force
Copy-Item -Path $Env:GITHUB_WORKSPACE\misc\packer\Update.exe -Destination ~\.nuget\packages\squirrel.windows\1.9.1\tools\ -Force
~\.nuget\packages\squirrel.windows\1.9.1\tools\Squirrel.exe --no-msi --releasify .\XIVLauncherCN.$refver.nupkg --setupIcon=.\XIVLauncher\Resources\dalamud_icon.ico --icon=.\XIVLauncher\Resources\dalamud_icon.ico
Start-Sleep -s 60
try
{
rm ".\Releases\$($delta_file.name)"
}
catch
{
}
rm ".\Releases\$($full_file.name)"
- name: Create Release
uses: softprops/action-gh-release@91409e712cf565ce9eff10c87a8d1b11b81757ae
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: src\Releases\**
name: Release ${{ steps.build-squirrel.outputs.version }}
body_path: RELEASE.md
prerelease: true
- name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@a3f74cfd584b0658320aec5e94ab6a8d16dca05f
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
files: ./src/Releases/*.exe
build:
name: Build on Windows
runs-on: windows-2022
if: "!startsWith(github.ref, 'refs/tags/')"
steps:
- uses: actions/checkout@v1
- name: Initialize Submodules
run: git submodule update --init --recursive
- name: Restore Nuget Packages
run: |
cd .\src\
dotnet restore
cd ..
- name: Define VERSION
run: |
$env:COMMIT = $env:GITHUB_SHA.Substring(0, 7)
$env:REPO_NAME = $env:GITHUB_REPOSITORY -replace '.*/'
$env:BRANCH = $env:GITHUB_REF -replace '.*/'
($env:REPO_NAME) >> VERSION
($env:BRANCH) >> VERSION
($env:COMMIT) >> VERSION
- name: Build DotNet4 Master
run: |
cd "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\"
.\MSBuild.exe $Env:GITHUB_WORKSPACE\src\XIVLauncher.sln /t:Build /p:Configuration=ReleaseNoUpdate
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: xivlauncher-artifact
path: src\bin\