Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
helloplhm-qwq committed Jan 31, 2024
2 parents 54222f8 + 2899cac commit 39caeeb
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions .github/workflows/build_beta.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# this workflow using github actions to build a binary exe file for windows users

name: build beta

on:
Expand All @@ -9,8 +7,11 @@ on:
branches: [main]

jobs:
build-windows:
runs-on: windows-latest
build:
strategy:
matrix:
runs-on: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout git repo
uses: actions/checkout@v2
Expand All @@ -26,37 +27,37 @@ jobs:
- name: Install dependencies
run: python -m pip install -r ./requirements.txt

- name: Build EXE
- name: Build
run: python build.py build test

- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: windows
name: dist-${{ matrix.runs-on }}
path: ./dist

build-linux:

post:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v2

- name: Setup Python 3.11
uses: actions/setup-python@v2
- name: Download Build Files
uses: actions/download-artifact@v4
with:
python-version: '3.11'
path: dist
pattern: dist-*
merge-multiple: false

- name: Install pyinstaller
run: python -m pip install pyinstaller

- name: Install dependencies
run: python -m pip install -r ./requirements.txt

- name: Build Executable
run: python build.py build test

- name: Upload
uses: actions/upload-artifact@v2
with:
name: linux
path: ./dist
- 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 }}

0 comments on commit 39caeeb

Please sign in to comment.