-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (64 loc) · 2.66 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
name: Build
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup ENV
run: echo "VERSION=$(date '+%Y.%-m.%-d')-prerelease" >> $GITHUB_ENV
- name: Setup Backend
run: |
gh repo clone DesterLib/Backend ${{ github.WORKSPACE }}/Backend
rm -rf ${{ github.WORKSPACE }}/Backend/.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.10.4'
- name: Setup Frontend
run: |
gh repo clone DesterLib/Frontend ${{ github.WORKSPACE }}/Frontend
rm -rf ${{ github.WORKSPACE }}/Frontend/.git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Frontend Dependencies
run: |
jq '.version="${{ env.VERSION }}"' ${{ github.WORKSPACE }}/Frontend/package.json --indent 4 > ${{ github.WORKSPACE }}/Frontend/tmp-package.json && mv ${{ github.WORKSPACE }}/Frontend/tmp-package.json ${{ github.WORKSPACE }}/Frontend/package.json
npm -C ${{ github.WORKSPACE }}/Frontend ci
- name: Install Desktop Dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9
sudo add-apt-repository 'deb [arch=amd64] https://mirror.mxe.cc/repos/apt focal main'
sudo apt -qq update
sudo apt install -y --allow-downgrades libpcre2-8-0=10.34-7
sudo apt install -y wine32
- name: Build Frontend and Desktop
run: npm -C ${{ github.WORKSPACE }}/Frontend run electron:build
env:
CI: false
- name: Package Server
run: |
cp -rf ${{ github.WORKSPACE }}/Frontend/build ${{ github.WORKSPACE }}/Backend
cd ${{ github.WORKSPACE }}/Backend
zip -r ${{ github.WORKSPACE }}/Dester.v${{ env.VERSION }}.zip *
cd ${{ github.WORKSPACE }}
- name: Package Desktop
run: mv ${{ github.WORKSPACE }}/Frontend/dist/Dester.Desktop.*.exe ${{ github.WORKSPACE }}/Dester.Desktop.v${{ env.VERSION }}.exe
- name: Generate CHANGELOG
run: curl -s https://gist.githubusercontent.com/EverythingSuckz/d74acde00ea0ed9415ec5b2b7872f343/raw | python >> CHANGELOGS.txt
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOGS.txt
files: |
Dester.v${{ env.VERSION }}.zip
Dester.Desktop.v${{ env.VERSION }}.exe
prerelease: true
tag_name: v${{ env.VERSION }}