Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff S committed Mar 20, 2022
1 parent 360b489 commit a7ca5fd
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit a7ca5fd

Please sign in to comment.