-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (92 loc) · 3.77 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
name: Cross-Platform Build
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
short_sha: ${{ steps.short_sha.outputs.short_sha }}
steps:
- name: Set sha
id: short_sha
run: echo "short_sha=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_OUTPUT
build-linux:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Build binary
run: pyinstaller src/lang_detect.py
- name: Zip the dist folder
run: zip -r lang-detect-${{ needs.prepare.outputs.short_sha }}-linux-x86_64.zip dist/
- name: Upload ZIP to FTP
run: |
curl -T lang-detect-${{ needs.prepare.outputs.short_sha }}-linux-x86_64.zip ftp://dev.linux.build.pdfix.net/public/builds/plug-ins/lang-detect/main/${{ needs.prepare.outputs.short_sha }}/ --user "${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}" --ftp-create-dirs
build-windows:
runs-on: windows-latest
needs: prepare
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build binary
run: pyinstaller src/lang_detect.py
- name: Zip the dist folder
run: Compress-Archive -Path dist/* -DestinationPath lang-detect-${{ needs.prepare.outputs.short_sha }}-windows-x86_64.zip
- name: Upload ZIP to FTP
run: |
curl -T lang-detect-${{ needs.prepare.outputs.short_sha }}-windows-x86_64.zip ftp://dev.linux.build.pdfix.net/public/builds/plug-ins/lang-detect/main/${{ needs.prepare.outputs.short_sha }}/ --user "${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}" --ftp-create-dirs
build-macos-arm64:
runs-on: macos-14
needs: prepare
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Build ARM64 binary
run: pyinstaller --target-architecture=arm64 src/lang_detect.py
- name: Zip the dist folder
run: zip -r lang-detect-${{ needs.prepare.outputs.short_sha }}-mac-arm64.zip dist/
- name: Upload ZIP to FTP
shell: bash
run: |
curl -T lang-detect-${{ needs.prepare.outputs.short_sha }}-mac-arm64.zip ftp://dev.linux.build.pdfix.net/public/builds/plug-ins/lang-detect/main/${{ needs.prepare.outputs.short_sha }}/ --user "${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}" --ftp-create-dirs
build-macos-x86_64:
runs-on: macos-latest
needs: prepare
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install dependencies
run: pip install pyinstaller
- name: Build x86_64 binary
run: pyinstaller --target-architecture=x86_64 src/lang_detect.py
- name: Zip the dist folder
run: zip -r lang-detect-${{ needs.prepare.outputs.short_sha }}-mac-x86_64.zip dist/
- name: Upload ZIP to FTP
run: |
curl -T lang-detect-${{ needs.prepare.outputs.short_sha }}-mac-x86_64.zip ftp://dev.linux.build.pdfix.net/public/builds/plug-ins/lang-detect/main/${{ needs.prepare.outputs.short_sha }}/ --user "${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}" --ftp-create-dirs