Allow running the program with a GUI #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: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10"] | |
poetry-version: ["1.4.2"] | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install system dependencies | |
run: sudo apt-get install python-wxgtk3.0-dev | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
- name: Run image | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: View poetry --help | |
run: poetry --help | |
- name: Install dependencies | |
run: poetry install | |
- name: Build execution file | |
run: poetry run pyinstaller main.py --onefile --windowed | |
- name: Sign the macos-version build | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: codesign --force -s - ./dist/main | |
- name: Make binary executable | |
if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' }} | |
run: chmod +x ./dist/main | |
- name: Rename built binary | |
run: poetry run mv ./dist/main ./dist/feedback-data-converter-windows | |
if: ${{ matrix.os == 'windows-latest' }} | |
- name: Rename built binary | |
run: poetry run mv ./dist/main ./dist/feedback-data-converter-linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
- name: Rename built binary | |
run: poetry run mv ./dist/main ./dist/feedback-data-converter-macos | |
if: ${{ matrix.os == 'macos-latest' }} | |
- name: Store built binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: converter-binary | |
path: dist | |
retention-days: 5 | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download built binary | |
uses: actions/download-artifact@v3 | |
with: | |
name: converter-binary | |
path: ./dist/ | |
- name: Set env for release | |
run: echo "DATE=$(date +'%Y-%m-%d/%H-%M')" >> $GITHUB_ENV | |
- uses: rickstaa/action-create-tag@v1 | |
id: "tag_create" | |
with: | |
tag: "${{ env.DATE }}" | |
tag_exists_error: true | |
message: Release ${{ env.DATE }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ./dist/* | |
name: Release ${{ env.DATE }} | |
tag_name: "${{ env.DATE }}" | |
permissions: | |
contents: write |