-
Notifications
You must be signed in to change notification settings - Fork 30
125 lines (106 loc) · 3.17 KB
/
dotnet-desktop.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
name: Build
on:
push:
tags:
- '*'
env:
DIST_DIR: /tmp/builds
ENABLE_NATIVE_LIBS: true
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
build: win-x64
file_name: win_amd64
- os: ubuntu-latest
build: linux-x64
file_name: linux_amd64
- os: macos-latest
build: osx-arm64
file_name: macos_arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- if: matrix.build == 'win-x64'
name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- if: matrix.build == 'win-x64'
name: Download libs
run: |
mkdir SubRenamer\native
$BASE_URL = "https://github.com/qwqcode/qwqcode/releases/download/dotnet-lib/"
$FILES = "av_libglesv2.lib,libSkiaSharp.lib,libHarfBuzzSharp.lib"
$FILES.Split(",") | ForEach-Object {
Invoke-WebRequest -Uri "$BASE_URL$_" -OutFile "SubRenamer\native\$_"
}
- name: Restore
run: dotnet restore -r ${{ matrix.build }}
- if: matrix.build != 'osx-arm64'
name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- if: matrix.build == 'win-x64'
name: Build (win)
run: |
cd scripts
.\build-win.ps1
New-Item -ItemType Directory -Force -Path $env:DIST_DIR
Copy-Item -Path dist\*.zip -Destination $env:DIST_DIR
- if: matrix.build == 'linux-x64'
name: Build (linux)
run: |
cd scripts &&./build-linux.sh
mkdir -p $DIST_DIR && cp dist/*.tar.gz $DIST_DIR
- if: matrix.build == 'osx-arm64'
name: Build (macOS)
run: |
cd scripts && ./build-macos.sh
mkdir -p $DIST_DIR && cp dist/*.zip $DIST_DIR
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.file_name }}
path: ${{ env.DIST_DIR }}/*
if-no-files-found: error
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download builds
uses: actions/download-artifact@v4
with:
path: ${{ env.DIST_DIR }}
pattern: build-*
merge-multiple: true
# checksums.txt
- name: Calculate checksums.txt
run: |
cd $DIST_DIR
sha256sum * > checksums.txt
# print checksums.txt
cat checksums.txt
FILES=$(find ${DIST_DIR} -type f -exec readlink -f {} \;)
echo -e "RELEASE_FILES<<EOF" >> $GITHUB_ENV
echo -e "$FILES" >> $GITHUB_ENV
echo -e "EOF" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
prerelease: false
files: ${{ env.RELEASE_FILES }}
generate_release_notes: true
draft: true