File tree Expand file tree Collapse file tree 6 files changed +35
-7
lines changed Expand file tree Collapse file tree 6 files changed +35
-7
lines changed Original file line number Diff line number Diff line change 33
33
cd v2rayN
34
34
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
35
35
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
36
+ dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64
37
+ dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64
36
38
37
39
- name : Upload build artifacts
38
40
uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change 33
33
cd v2rayN
34
34
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
35
35
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
36
+ dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64
37
+ dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64
36
38
37
39
- name : Upload build artifacts
38
40
uses : actions/upload-artifact@v4
56
58
with :
57
59
file : ${{ github.workspace }}/v2rayN*.dmg
58
60
tag : ${{ github.event.inputs.release_tag }}
61
+ file_glob : true
62
+
63
+ # release zip archive
64
+ - name : Package release zip archive
65
+ if : github.event.inputs.release_tag != ''
66
+ run : |
67
+ chmod 755 package-release-zip.sh
68
+ ./package-release-zip.sh $OutputArch $OutputPath64
69
+ ./package-release-zip.sh $OutputArchArm $OutputPathArm64
70
+
71
+ - name : Upload zip archive to release
72
+ uses : svenstaro/upload-release-action@v2
73
+ if : github.event.inputs.release_tag != ''
74
+ with :
75
+ file : ${{ github.workspace }}/v2rayN*.zip
76
+ tag : ${{ github.event.inputs.release_tag }}
59
77
file_glob : true
Original file line number Diff line number Diff line change 35
35
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64
36
36
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
37
37
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc
38
+ dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64
39
+ dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
40
+ dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc
41
+
38
42
39
43
- name : Upload build artifacts
40
44
uses : actions/upload-artifact@v4
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ PackagePath="v2rayN-Package-${Arch}"
8
8
mkdir -p " ${PackagePath} /DEBIAN"
9
9
mkdir -p " ${PackagePath} /opt"
10
10
cp -rf $OutputPath " ${PackagePath} /opt/v2rayN"
11
+ echo " When this file exists, app will not store configs under this folder" > " ${PackagePath} /opt/v2rayN/NotStoreConfigHere.txt"
11
12
12
13
if [ $Arch = " linux-64" ]; then
13
14
Arch2=" amd64"
44
45
45
46
sudo chmod 0755 " ${PackagePath} /DEBIAN/postinst"
46
47
sudo chmod 0755 " ${PackagePath} /opt/v2rayN/v2rayN"
48
+ sudo chmod 0755 " ${PackagePath} /opt/v2rayN/AmazTool"
47
49
48
50
# desktop && PATH
49
51
Original file line number Diff line number Diff line change @@ -4,14 +4,10 @@ Arch="$1"
4
4
OutputPath=" $2 "
5
5
Version=" $3 "
6
6
7
- FileName=" v2rayN-${Arch} .zip"
8
- wget -nv -O $FileName " https://github.com/2dust/v2rayN-core-bin/raw/refs/heads/master/$FileName "
9
- 7z x $FileName
10
- cp -rf v2rayN-${Arch} /* $OutputPath
11
-
12
7
PackagePath=" v2rayN-Package-${Arch} "
13
8
mkdir -p " $PackagePath /v2rayN.app/Contents/Resources"
14
9
cp -rf " $OutputPath " " $PackagePath /v2rayN.app/Contents/MacOS"
10
+ echo " When this file exists, app will not store configs under this folder" > " $PackagePath /v2rayN.app/Contents/MacOS/NotStoreConfigHere.txt"
15
11
chmod +x " $PackagePath /v2rayN.app/Contents/MacOS/v2rayN"
16
12
17
13
mkdir -p " $PackagePath /icons.iconset"
@@ -43,7 +39,7 @@ cat >"$PackagePath/v2rayN.app/Contents/Info.plist" <<-EOF
43
39
<key>CFBundleIconName</key>
44
40
<string>AppIcon</string>
45
41
<key>CFBundleIdentifier</key>
46
- <string>v2rayN.desktop </string>
42
+ <string>2dust.v2rayN </string>
47
43
<key>CFBundleName</key>
48
44
<string>v2rayN</string>
49
45
<key>CFBundlePackageType</key>
Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ public static int GetFreePort(int defaultPort = 9090)
517
517
518
518
public static bool UpgradeAppExists ( out string fileName )
519
519
{
520
- fileName = Path . Combine ( Utils . StartupPath ( ) , GetExeName ( "AmazTool" ) ) ;
520
+ fileName = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , GetExeName ( "AmazTool" ) ) ;
521
521
return File . Exists ( fileName ) ;
522
522
}
523
523
@@ -675,6 +675,12 @@ public static bool HasWritePermission()
675
675
{
676
676
try
677
677
{
678
+ //When this file exists, it is equivalent to having no permission to read and write
679
+ if ( File . Exists ( Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "NotStoreConfigHere.txt" ) ) )
680
+ {
681
+ return false ;
682
+ }
683
+
678
684
var tempPath = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "guiTemps" ) ;
679
685
if ( ! Directory . Exists ( tempPath ) )
680
686
{
You can’t perform that action at this time.
0 commit comments