-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (88 loc) · 3.25 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
name: Build XIVDeck
on:
release:
types: [published]
jobs:
build-ffxivplugin:
name: Build XIVDeck FFXIV Plugin
runs-on: windows-latest
permissions:
id-token: write
contents: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore Dependencies
run: dotnet restore
- name: Download Dalamud
run: |
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
- name: Build Plugin
run: |
$ver = '${{ github.ref }}' -replace 'refs/tags/v',''
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:AssemblyVersion=$ver -p:Version=$ver -p:FileVersion=$ver FFXIVPlugin'
- name: Report Build Hash
run: |
$fileHashInfo = Get-FileHash .\FFXIVPlugin\bin\Release\XIVDeck.FFXIVPlugin\latest.zip;
Write-Output "Hash of XIVDeck.FFXIVPlugin: $($fileHashInfo.Hash)";
- name: Attest Build
uses: actions/attest-build-provenance@v1
with:
subject-path: |
.\FFXIVPlugin\bin\Release\XIVDeck.FFXIVPlugin.dll
.\FFXIVPlugin\bin\Release\**\XIVDeck.FFXIVPlugin.*.dll
.\FFXIVPlugin\bin\Release\XIVDeck.FFXIVPlugin\latest.zip
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: XIVDeck.FFXIVPlugin
path: .\FFXIVPlugin\bin\Release\XIVDeck.FFXIVPlugin\
build-sdplugin:
name: Build XIVDeck Stream Deck Plugin
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
attestations: write
defaults:
run:
working-directory: ./SDPlugin
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: yarn install
- name: Patch Version
run: |
export APP_VERSION=$(echo '${{ github.ref }}' | sed "s!refs/tags/v!!")
yarn version --new-version $APP_VERSION --no-git-tag-version
- name: Build for Release
run: yarn build-release
- name: Package Plugin
run: (cd dist && zip -r dev.wolf.xivdeck.streamDeckPlugin dev.wolf.xivdeck.sdPlugin)
- name: Report Build Hash
run: echo "[Build Audit] $(sha256sum dist/dev.wolf.xivdeck.streamDeckPlugin)"
- name: Attest Build
uses: actions/attest-build-provenance@v1
with:
subject-path: ./SDPlugin/dist/dev.wolf.xivdeck.streamDeckPlugin
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: XIVDeck.SDPlugin
path: ./SDPlugin/dist/dev.wolf.xivdeck.streamDeckPlugin
- name: Add Artifact to Release
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./SDPlugin/dist/dev.wolf.xivdeck.streamDeckPlugin
asset_name: XIVDeck.streamDeckPlugin
asset_content_type: application/zip