forked from loboris/ktool
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff S
committed
Mar 20, 2022
1 parent
360b489
commit a7ca5fd
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Release | ||
|
||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
steps: | ||
- name: release | ||
if: strategy.job-index == 0 | ||
uses: actions/create-release@v1 | ||
id: create-release | ||
with: | ||
draft: false | ||
prerelease: false | ||
release_name: Release ${{ github.ref }} | ||
tag_name: ${{ github.ref }} | ||
body: Builds of ktool for Mac, Linux, and Windows | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
upload-release-assets: | ||
needs: create-release | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pyserial pyinstaller | ||
- name: Create the executable | ||
run: pyinstaller --onefile ktool.py | ||
|
||
- name: Upload the Mac executable | ||
if: matrix.os == 'macos-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: dist/ktool | ||
asset_name: ktool-mac | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload the Linux executable | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: dist/ktool | ||
asset_name: ktool-linux | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload the Windows executable | ||
if: matrix.os == 'windows-latest' | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: dist/ktool.exe | ||
asset_name: ktool-win.exe | ||
asset_content_type: application/octet-stream |