forked from alex-ilin/WebEdit
-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (109 loc) · 5.12 KB
/
Copy pathbuild.yml
File metadata and controls
122 lines (109 loc) · 5.12 KB
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
name: Native AOT Build
on:
push:
pull_request:
branches:
- master
permissions:
contents: read
env:
PLUGIN_NAME: 'WebEdit'
jobs:
xds:
runs-on: windows-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Build ${{ env.PLUGIN_NAME }}.win32
run: |
if ( $(Get-FileHash -A SHA512 .\xds-260-win32.zip).Hash -ne $(Get-Content .\xds-260-win32.zip.sha512) ) { exit 1 }
$env:PATH += ";${pwd}\xds\bin"
7z x .\xds-260-win32.zip
cmd /c .\Src\compile.bat
echo D | xcopy /DIY ${{ github.workspace }}\WebEdit\Resources Config
$pkgVersion="$((Get-Item ${{ env.PLUGIN_NAME }}.dll).VersionInfo.ProductVersion)"
7z a -tzip -y "..\${{ env.PLUGIN_NAME }}.$pkgVersion.win32.zip" ${{ env.PLUGIN_NAME }}.dll .\Config
echo "PKG_VERSION=$pkgVersion" >> $env:GITHUB_ENV
echo "RELEASE_VERSION=$((Get-Item ${{ env.PLUGIN_NAME }}.dll).VersionInfo.FileVersion)" >> $env:GITHUB_ENV
working-directory: Legacy-v2.1
- name: Upload ${{ env.PLUGIN_NAME }}.${{ env.RELEASE_VERSION }}.win32
if: ${{ !contains(github.ref, 'tags') }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PLUGIN_NAME }}.${{ env.RELEASE_VERSION }}.win32
path: |
Legacy-v2.1/${{ env.PLUGIN_NAME }}.dll
Legacy-v2.1/Config/
- name: Upload ${{ env.PLUGIN_NAME }}.${{ env.PKG_VERSION }}.win32.zip
if: ${{ contains(github.ref, 'tags') }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PLUGIN_NAME }}.${{ env.PKG_VERSION }}.win32
path: ${{ env.PLUGIN_NAME }}.${{ env.PKG_VERSION }}.win32.zip
publish_aot:
needs: xds
strategy:
matrix:
target_runtime: [ x64, arm64 ]
runs-on: windows-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
with:
dotnet-version: 8.0.x
- name: Build ${{ env.PLUGIN_NAME }}.${{ matrix.target_runtime }}
run: |
dotnet restore
dotnet build -r win-${{ matrix.target_runtime }} -c Release
dotnet publish -r win-${{ matrix.target_runtime }} -c Release
echo D | xcopy /DIY .\Resources Config
echo F | xcopy /DVY .\bin\Release\net8.0-windows\win-${{ matrix.target_runtime }}\native\${{ env.PLUGIN_NAME }}.dll ${{ env.PLUGIN_NAME }}.dll
$pkgVersion="$((Get-Item ${{ env.PLUGIN_NAME }}.dll).VersionInfo.ProductVersion)"
7z a -tzip -y "..\${{ env.PLUGIN_NAME }}.$pkgVersion.${{ matrix.target_runtime }}.zip" ${{ env.PLUGIN_NAME }}.dll .\Config
echo "PKG_VERSION=$pkgVersion" >> $env:GITHUB_ENV
echo "RELEASE_VERSION=$((Get-Item ${{ env.PLUGIN_NAME }}.dll).VersionInfo.FileVersion)" >> $env:GITHUB_ENV
working-directory: WebEdit
- name: Upload ${{ env.PLUGIN_NAME }}.${{ env.RELEASE_VERSION }}.${{ matrix.target_runtime }}
if: ${{ !contains(github.ref, 'tags') }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PLUGIN_NAME }}.${{ env.RELEASE_VERSION }}.${{ matrix.target_runtime }}
path: |
WebEdit/${{ env.PLUGIN_NAME }}.dll
WebEdit/Config/
- name: Upload ${{ env.PLUGIN_NAME }}.${{ env.PKG_VERSION }}.${{ matrix.target_runtime }}.zip
if: ${{ contains(github.ref, 'tags') }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PLUGIN_NAME }}.${{ env.PKG_VERSION }}.${{ matrix.target_runtime }}
path: ${{ env.PLUGIN_NAME }}.${{ env.PKG_VERSION }}.${{ matrix.target_runtime }}.zip
publish_release:
if: ${{ contains(github.ref, 'tags') && github.event_name == 'push' }}
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- xds
- publish_aot
steps:
- name: Fetch release artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
path: bin
merge-multiple: true
- name: Generate release notes
run: |
printf '#### SHA256 Checksums\n\n' > sha256sums.md
find . -maxdepth 1 -type f -iname \*.zip -exec sh -c 'printf " %s\n" "$(sha256sum $(basename $1) | awk "{print \$1,\$2}")" >> sha256sums.md' _ {} \;
working-directory: bin
- name: Publish release
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
with:
body_path: 'bin/sha256sums.md'
fail_on_unmatched_files: true
files: "bin/*.zip"
name: "${{ github.ref_name }}"
prerelease: ${{ contains(github.ref_name, 'pre') || contains(github.ref_name, 'rc') }}
tag_name: "${{ github.ref_name }}"