Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Commit

Permalink
workflow build binary (pyinstaller)
Browse files Browse the repository at this point in the history
  • Loading branch information
glebliutsko committed Mar 4, 2021
1 parent ce8e307 commit 669ceb5
Showing 1 changed file with 81 additions and 15 deletions.
96 changes: 81 additions & 15 deletions .github/workflows/upload_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

jobs:
build:
wheel-sdist:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -16,32 +16,23 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Build package
run: |
poetry install
poetry build -n
- name: Get version
id: version
run: |
echo ::set-output name=version::$(poetry version -s)
- name: Chack version
- name: Build package
run: |
if [ "${{ steps.version.outputs.version }}" != "${GITHUB_REF#refs/tags/}" ]; then exit 1; fi
poetry install
poetry build -n
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release (wheel)
uses: actions/upload-release-asset@v1
env:
Expand All @@ -51,7 +42,6 @@ jobs:
asset_path: ./dist/spolyrics-${{ steps.version.outputs.version }}-py3-none-any.whl
asset_name: spolyrics-${{ steps.version.outputs.version }}-py3-none-any.whl
asset_content_type: application/zip

- name: Upload Release (sdist)
uses: actions/upload-release-asset@v1
env:
Expand All @@ -60,4 +50,80 @@ jobs:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dist/spolyrics-${{ steps.version.outputs.version }}.tar.gz
asset_name: spolyrics-${{ steps.version.outputs.version }}.tar.gz
asset_content_type: application/zip
asset_content_type: application/zip

linux-bin:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Get version
id: version
run: |
echo ::set-output name=version::$(poetry version -s)
- name: Build package
run: |
poetry install
poetry run pyinstaller --onefile spolyrics/__main__.py
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release (linux-bin)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dist/__main__
asset_name: spolyrics-linux
asset_content_type: application/octet-stream

windows-bin:
runs-on: windows-latest
strategy:
matrix:
python-version: [ 3.9 ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Get version
id: version
run: |
echo "::set-output name=version::$(poetry version -s)"
- name: Build package
run: |
poetry install
poetry run pyinstaller --onefile -w spolyrics/__main__.py
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release (linux-bin)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./dist/__main__.exe
asset_name: spolyrics-windows.exe
asset_content_type: application/octet-stream

0 comments on commit 669ceb5

Please sign in to comment.