-
Notifications
You must be signed in to change notification settings - Fork 122
66 lines (55 loc) · 2.03 KB
/
build_beta.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
name: build beta
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- '.gitignore'
pull_request:
branches: [main]
jobs:
build:
strategy:
matrix:
runs-on: [windows-latest, macos-latest, ubuntu-latest, ubuntu-20.04]
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout git repo
uses: actions/checkout@v2
- name: Setup Python 3.11
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Install pyinstaller
run: python -m pip install pyinstaller
- name: Install dependencies
run: python -m pip install -r ./requirements.txt
- name: Build
run: python build.py build test
- name: Upload
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.runs-on }}
path: ./dist
post:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v2
- name: Download Build Files
uses: actions/download-artifact@v4
with:
path: dist
pattern: dist-*
merge-multiple: false
- name: Get File Address
run: |
echo "windowsFile=./dist/dist-windows-latest/lx-music-api-server_$(git rev-parse --short HEAD).exe" >> $GITHUB_ENV
echo "macosFile=./dist/dist-macos-latest/lx-music-api-server_$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "linuxFile=./dist/dist-ubuntu-latest/lx-music-api-server_$(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: Post to Channel
run: |
echo ${{ secrets.SCRIPT_BASE64 }} | base64 -d > test.py
ESCAPED=`python test.py`
curl -s -v "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMediaGroup?chat_id=${{ secrets.TELEGRAM_ID }}&media=%5B%7B%22type%22:%22document%22,%20%22media%22:%22attach://windows%22,%22parse_mode%22:%22MarkdownV2%22,%22caption%22:${ESCAPED}%7D%5D" -F windows=@${{ env.windowsFile }}