Create build-to-release.yml
This commit is contained in:
parent
ab8f9e1b1a
commit
901ab98fba
1 changed files with 64 additions and 0 deletions
64
.github/workflows/build-to-release.yml
vendored
Normal file
64
.github/workflows/build-to-release.yml
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
name: Build Windows LoaderSpot
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [x86, x64]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.13'
|
||||
architecture: ${{ matrix.architecture }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install aiohttp
|
||||
pip install tqdm
|
||||
pip install pyinstaller
|
||||
|
||||
- name: Build executable
|
||||
run: |
|
||||
pyinstaller --onefile --clean --name LoaderSpot_${{ matrix.architecture }} LoaderSpot.py
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: LoaderSpot_${{ matrix.architecture }}
|
||||
path: dist/LoaderSpot_${{ matrix.architecture }}.exe
|
||||
|
||||
- name: Get latest release
|
||||
id: latest_release
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const releases = await github.rest.repos.listReleases({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo
|
||||
});
|
||||
return releases.data[0].id;
|
||||
result-encoding: string
|
||||
|
||||
- name: Upload to Release
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const releaseId = ${{ steps.latest_release.outputs.result }};
|
||||
|
||||
await github.rest.repos.uploadReleaseAsset({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: releaseId,
|
||||
name: `LoaderSpot_${{ matrix.architecture }}.exe`,
|
||||
data: fs.readFileSync(`dist/LoaderSpot_${{ matrix.architecture }}.exe`)
|
||||
});
|
||||
Loading…
Reference in a new issue