Create Executable #208
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
name: Create Executable | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version of magic-wormhole to build" | |
jobs: | |
create-executable: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Check build | |
id: check-build | |
uses: ./.github/actions/build-environment | |
with: | |
version: ${{ inputs.version }} | |
- name: Build executable | |
run: | | |
pip install pyinstaller magic-wormhole==${{ steps.check-build.outputs.version }} | |
pyinstaller ./launcher.py -F -c --distpath=. --clean --onefile --additional-hooks-dir=hooks --name=wormhole | |
$MD5_CHECKSUM=(Get-FileHash ./wormhole.exe -Algorithm MD5).Hash | |
$SHA1_CHECKSUM=(Get-FileHash ./wormhole.exe -Algorithm SHA1).Hash | |
$SHA256_CHECKSUM=(Get-FileHash ./wormhole.exe -Algorithm SHA256).Hash | |
echo "MD5 $MD5_CHECKSUM wormhole.exe" >> wormhole.exe.checksum.txt | |
echo "SHA1 $SHA1_CHECKSUM wormhole.exe" >> wormhole.exe.checksum.txt | |
echo "SHA256 $SHA256_CHECKSUM wormhole.exe" >> wormhole.exe.checksum.txt | |
- name: Upload executable artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wormhole | |
path: wormhole.* | |
- name: Create release | |
id: create-release | |
if: ${{ steps.check-build.outputs.exists == 'false' }} | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.check-build.outputs.version }} | |
release_name: Release ${{ steps.check-build.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload wormhole executable | |
if: ${{ steps.check-build.outputs.exists == 'false' }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./wormhole.exe | |
asset_name: wormhole.exe | |
asset_content_type: application/octet-stream | |
- name: Upload checksums | |
if: ${{ steps.check-build.outputs.exists == 'false' }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./wormhole.exe.checksum.txt | |
asset_name: wormhole.exe.checksum.txt | |
asset_content_type: text/plain |