From 2c9d36e350916cf56cfe02dc2fb9f1638e591234 Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Thu, 5 Oct 2023 09:43:27 +0300 Subject: [PATCH] Add building in CI --- .github/workflows/build.yml | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ceb2275 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,73 @@ +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: 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: install pyinstaller + run: poetry run pip install -U pyinstaller + - name: Build execution file + run: poetry run pyinstaller main.py --onefile + + - name: Sign the macos-version build + if: ${{ matrix.os == 'macos-latest' }} + run: codesign --force -s - ./dist/main + + - name: Rename built binary + run: poetry run mv ./dist/main ./dist/main-${{ matrix.os }} + + - 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: + + - name: Download built binary + uses: actions/download-artifact@v3 + with: + name: converter-binary + path: ./dist/ + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: ./dist/* + name: converter-binary + tag_name: release + permissions: + contents: write +