-
Notifications
You must be signed in to change notification settings - Fork 136
138 lines (125 loc) · 4.45 KB
/
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
126
127
128
129
130
131
132
133
134
135
136
137
138
name: Build Desktop
on:
push:
tags:
- "d*"
permissions:
contents: write
jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
target:
- aarch64-apple-darwin
- x86_64-apple-darwin
- x86_64-pc-windows-msvc
- aarch64-unknown-linux-gnu
- x86_64-unknown-linux-gnu
include:
- os: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
target: 'aarch64-apple-darwin'
- os: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
target: 'x86_64-apple-darwin'
- os: 'windows-latest'
args: '--target x86_64-pc-windows-msvc'
target: 'x86_64-pc-windows-msvc'
x86_64: true
- os: 'ubuntu-latest'
args: '--target aarch64-unknown-linux-gnu'
target: 'aarch64-unknown-linux-gnu'
aarch64: true
- os: 'ubuntu-latest'
args: '--target x86_64-unknown-linux-gnu'
target: 'x86_64-unknown-linux-gnu'
x86_64: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 18
- name: Checkout iptv-checker-ui-interface
uses: actions/checkout@v4
with:
repository: zhimin-dev/iptv-checker-ui-interface
path: iptv-checker-ui-interface
token: ${{ secrets.GH_PAT }}
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: rust up target
run: |
rustup target add ${{ matrix.target }}
- name: install webkit2gtk (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0
- name: install app dependencies and build it
working-directory: ./iptv-checker-ui-interface
run: yarn && yarn build
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: ${{ matrix.args }}
- name: Build archive
shell: bash
working-directory: ./iptv-checker-ui-interface
run: |
binaryName="iptv-checker-desktop"
gitTagName="${{github.ref_name}}"
echo $gitTagName
tagVersion=${gitTagName//d/}
if [tagVersion = "main"]; then
tagVersion=$(git describe --tags --abbrev=0)
fi
version=$(echo $tagVersion | cut -d '.' -f 1-3)
echo $version
dirname="${binaryName}_${version}-${{ matrix.target }}"
filename="${binaryName}_${version}_"
echo $dirname
echo $(ls src-tauri/target/${{ matrix.target }}/release/bundle/dmg/)
mkdir "$dirname"
if [ "${{ matrix.os }}" = "macos-latest" ]; then
suffix="aarch64"
if [ "${{ matrix.target }}" = "x86_64-apple-darwin" ]; then
suffix="x64"
echo $suffix
echo "xxxxx"
fi
realName="${filename}${suffix}"
echo $realName
echo ${{matrix.target}}
mv "src-tauri/target/${{ matrix.target }}/release/bundle/dmg/${realName}.dmg" "$dirname/"
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
suffix="amd64"
if ["${{matrix.target}}" = "aarch64-unknown-linux-gnu"]; then
suffix="aarch64"
fi
realName="${filename}${suffix}"
echo $realName
mv "src-tauri/target/${{ matrix.target }}/release/bundle/deb/${realName}.deb" "$dirname/"
elif [ "${{ matrix.os }}" = "windows-latest" ]; then
suffix="x64-setup"
realName="${filename}${suffix}"
echo $realName
mv "src-tauri/target/${{ matrix.target }}/release/bundle/nsis/${realName}.exe" "$dirname/"
fi
if [ "${{ matrix.os }}" = "windows-latest" ]; then
7z a "$dirname.zip" "$dirname"
echo "ASSET=$dirname.zip" >> $GITHUB_ENV
else
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
fi
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./iptv-checker-ui-interface/${{ env.ASSET }}