Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
name: Build Windows LoaderSpot
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
strategy:
|
|
matrix:
|
|
architecture: [x86, x64]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
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@v4
|
|
with:
|
|
name: LoaderSpot_${{ matrix.architecture }}
|
|
path: dist/LoaderSpot_${{ matrix.architecture }}.exe
|
|
|
|
- name: Get latest release
|
|
id: latest_release
|
|
uses: actions/github-script@v8
|
|
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@v8
|
|
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`)
|
|
});
|