forked from popcorn-official/popcorn-desktop
-
Notifications
You must be signed in to change notification settings - Fork 13
145 lines (120 loc) · 3.71 KB
/
build.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
139
140
141
142
143
144
145
name: Latest Build
on:
push:
branches:
- '*'
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
nwjs: ['0.44.5', '0.85.0']
steps:
- name: Context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://git@github.com/
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: yarn version
run: |
yarn version
- name: node version
run: |
node --version
- uses: kiriles90/variable-mapper@master
with:
key: "${{ matrix.os }}"
map: |
{
"ubuntu-latest": { "platform": "linux", "dist": "linux32,linux64" },
"macOS-latest": { "platform": "osx", "dist": "osx64" },
"windows-latest": { "platform": "win", "dist": "win32,win64" }
}
- name: Build info
run: echo Build ${{ env.dist }} on nw-v${{ matrix.nwjs }}
- name: Build App
run: |
yarn
yarn gulp dist --platforms=${{ env.platform == 'win' && '"' || '' }}${{ env.dist }}${{ env.platform == 'win' && '"' || '' }} --nwVersion=${{ matrix.nwjs }}
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: ${{ env.platform }}-${{ matrix.nwjs }}
path: build
packs:
needs: build
name: Packs
runs-on: ubuntu-latest
strategy:
matrix:
nwjs: ['0.44.5', '0.85.0']
steps:
- name: Context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
with:
path: repo
persist-credentials: false
- uses: actions/download-artifact@v4
with:
name: linux-${{ matrix.nwjs }}
path: .
- name: Install packages and appimagetool
run: |
sudo apt update
sudo apt install -y libfuse2
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
- name: Build AppImage
run: |
VER=$(ls *-linux64*.zip | sed 's/-linux64.*//')
echo $VER
unzip -q *-linux64*.zip -d $VER.AppDir
cp repo/dist/linux/appimage/* $VER.AppDir/
ln -s Popcorn-Time $VER.AppDir/AppRun
mkdir build
./appimagetool-x86_64.AppImage $VER.AppDir build/$VER-linux${{ matrix.nwjs == '0.44.5' && '-0.44.5' || '' }}.AppImage
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: linux-${{ matrix.nwjs }}.AppImage
path: build
release:
needs: packs
name: Release
runs-on: ubuntu-latest
steps:
- name: Context
if: startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R artifacts
- uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
allowUpdates: true
name: ${{ github.ref_name }}
artifacts: "artifacts/*"