fix: is pip my friend? #21
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: Build | |
on: | |
push: | |
paths: | |
- 'main.py' | |
- '.github/workflows/build.yml' | |
jobs: | |
build-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
python -m pip install pyinstaller | |
- name: Build for Linux | |
run: | | |
pyi-makespec main.py --onefile --noconsole | |
pyinstaller --clean main.spec | |
ls dist | |
- name: bottom text | |
uses: actions/upload-artifact@v3 | |
with: | |
name: river-linux | |
path: dist/main | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build for Windows | |
run: | | |
pyi-makespec main.py --onefile --noconsole | |
pyinstaller --clean main.spec | |
- name: Save artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: river-windows | |
path: dist/main.exe | |
release: | |
runs-on: ubuntu-latest | |
needs: [build-windows, build-linux] | |
permissions: write-all | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: river-windows | |
path: dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: river-linux | |
path: dist | |
- uses: reecetech/[email protected] | |
id: version | |
with: | |
scheme: semver | |
increment: patch | |
- name: Create release | |
id: release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
release_name: Release ${{ steps.version.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload builds | |
id: upload-release-asset | |
uses: sekwah41/upload-release-assets@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
asset_path: 'dist/main.exe' | |
asset_name: "main.exe" | |
asset_content_type: application/zip | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
- name: Oh upload this too | |
id: upload-release-asset2 | |
uses: sekwah41/upload-release-assets@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
asset_path: 'dist/main' | |
asset_name: "main" | |
asset_content_type: application/zip | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
# run build action pls |