-
Notifications
You must be signed in to change notification settings - Fork 330
102 lines (97 loc) · 4.37 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
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/goatcorp/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
Invoke-WebRequest -Uri $delta_file.browser_download_url -OutFile ".\Releases\$($delta_file.name)"
$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
~\.nuget\packages\squirrel.windows\1.9.1\tools\Squirrel.exe --no-msi --releasify .\XIVLauncher.$refver.nupkg --setupIcon=.\XIVLauncher\Resources\dalamud_icon.ico --icon=.\XIVLauncher\Resources\dalamud_icon.ico
Start-Sleep -s 60
rm ".\Releases\$($delta_file.name)"
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\