Skip to content

fix changes

fix changes #10

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'cli-v*'
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.cli.txt
pip install pyinstaller
- name: Build with PyInstaller
run: pyinstaller --onefile cli.py
- name: Rename executable
run: mv ./dist/cli ./dist/cli-linux
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: cli-linux
path: ./dist/cli-linux
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.cli.txt
pip install pyinstaller
- name: Build with PyInstaller
run: pyinstaller --onefile cli.py
- name: Rename executable
run: mv ./dist/cli.exe ./dist/cli-windows.exe
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: cli-windows
path: ./dist/cli-windows.exe
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.cli.txt
pip install pyinstaller
- name: Build with PyInstaller
run: pyinstaller --onefile cli.py
- name: Rename executable
run: mv ./dist/cli ./dist/cli-macos
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: cli-macos
path: ./dist/cli-macos
release:
needs: [build-linux, build-windows, build-macos]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset - Linux
id: upload-release-asset-linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/cli-linux
asset_name: cli-linux
asset_content_type: application/octet-stream
- name: Upload Release Asset - Windows
id: upload-release-asset-windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/cli-windows.exe
asset_name: cli-windows.exe
asset_content_type: application/octet-stream
- name: Upload Release Asset - macOS
id: upload-release-asset-macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/cli-macos
asset_name: cli-macos
asset_content_type: application/octet-stream