Compare commits
4 Commits
6f37bcb081
...
d2af2531d0
| Author | SHA1 | Date | |
|---|---|---|---|
| d2af2531d0 | |||
| f4b45b4c10 | |||
| 9af491064e | |||
| 48b1d0be03 |
59
.github/workflows/build.yml
vendored
Normal file
59
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
output: confy-linux
|
||||||
|
- os: macos-latest
|
||||||
|
output: confy-macos
|
||||||
|
- os: windows-latest
|
||||||
|
output: confy-windows.exe
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: set up python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.13'
|
||||||
|
|
||||||
|
- name: install pyinstaller
|
||||||
|
run: pip install pyinstaller
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: pyinstaller --onefile main.py --name ${{ matrix.output }}
|
||||||
|
|
||||||
|
- name: get release upload url
|
||||||
|
id: get_release
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const release = await github.rest.repos.getReleaseByTag({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
tag: context.ref.replace('refs/tags/', '')
|
||||||
|
});
|
||||||
|
return release.data.upload_url;
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
|
- name: upload binary
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.get_release.outputs.result }}
|
||||||
|
asset_path: dist/${{ matrix.output }}
|
||||||
|
asset_name: ${{ matrix.output }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
Reference in New Issue
Block a user