Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build and release job #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Build and publish binaries"

permissions:
contents: write

on:
push:
tags:
- '*'

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}

build:
name: Build Release
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['windows-latest', 'ubuntu-latest', 'macos-latest']

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11

- run: pip install pyinstaller pillow
- run: pyinstaller -w -F --distpath ./dist/${{ runner.os }} -i src/icon.icns src/FarmUpload.py
- run: |
cp settings-example.json dist/${{ runner.os }}/
zip -r FarmUpload-${{ runner.os }}.zip dist/${{ runner.os }}/*
if: matrix.os == 'ubuntu-latest'
- run: |
cp settings-example.json dist/${{ runner.os }}/
zip -r FarmUpload-${{ runner.os }}.zip dist/${{ runner.os }}/*
if: matrix.os == 'macos-latest'
- run: |
copy settings-example.json dist/${{ runner.os }}/
powershell Compress-Archive -Path dist -DestinationPath FarmUpload-${{ runner.os }}.zip
if: matrix.os == 'windows-latest'
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.create_release.outputs.tag-name }}
files: FarmUpload-${{ runner.os }}.zip