-
Notifications
You must be signed in to change notification settings - Fork 325
140 lines (135 loc) · 5.73 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
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
permissions:
id-token: write
contents: write # Must be 'write' to create a release
attestations: write
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: Generate Hashes File
run: .\scripts\CreateHashList.ps1 .\src\bin
- name: Attest Artifacts
if: ${{ github.repository_owner == 'goatcorp' && github.event_name == 'push' }}
uses: actions/attest-build-provenance@v1
with:
subject-path: |
src/bin/XIVLauncher.exe
src/bin/XIVLauncher.*.dll
src/bin/XIVLauncher.*.exe
src/bin/hashes.json
- 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: Attest Setup
if: ${{ github.repository_owner == 'goatcorp' && github.event_name == 'push' }}
uses: actions/attest-build-provenance@v1
with:
subject-path: |
src/Releases/*.exe
src/Releases/*.nupkg
src/Releases/RELEASES
- name: Create Release
uses: softprops/action-gh-release@a74c6b72af54cfa997e81df42d94703d6313a2d0
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/')"
permissions:
id-token: write
contents: read
attestations: write
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: Generate Hashes File
run: .\scripts\CreateHashList.ps1 .\src\bin
- name: Attest Artifacts
if: ${{ github.repository_owner == 'goatcorp' && github.event_name == 'push' }}
uses: actions/attest-build-provenance@v1
with:
subject-path: |
src/bin/XIVLauncher.exe
src/bin/XIVLauncher.*.dll
src/bin/XIVLauncher.*.exe
src/bin/hashes.json
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: xivlauncher-artifact
path: src\bin\