upgrade pyinstaller #220
Workflow file for this run
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: create apps | |
on: | |
push: | |
tags: | |
- '*' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
create_release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Install project | |
run: poetry install --no-interaction | |
- name: pytest | |
run: | | |
source .venv/bin/activate | |
pytest --cov=./ezbeq --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
files: ./coverage.xml | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
- name: Generate changelog | |
id: changelog | |
uses: metcalfc/changelog-generator@v4.3.1 | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: ${{ steps.changelog.outputs.changelog }} | |
draft: false | |
prerelease: true | |
buildpypi: | |
name: Publish to Pypi | |
needs: create_release | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
url: https://pypi.org/p/ezbeq | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use node.js lts | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Setup node_modules | |
working-directory: ./ui | |
run: yarn install --frozen-lockfile | |
- name: Build UI | |
working-directory: ./ui | |
run: yarn build | |
- name: Get latest release version number | |
id: get_version | |
run: echo "version-without-v=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
- name: Set version | |
run: | | |
echo ${{ steps.get_version.outputs.version-without-v }} > ezbeq/VERSION | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Install project | |
run: poetry install --no-interaction | |
- name: Build dist | |
run: poetry build | |
- name: Publish a Python distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
- uses: octokit/request-action@v2.x | |
with: | |
route: POST /repos/{owner}/{repo}/dispatches | |
owner: 3ll3d00d | |
repo: ezbeq-jr | |
event_type: 'trigger' | |
env: | |
GITHUB_TOKEN: ${{ secrets.EZBEQJR }} | |
buildpyinstaller: | |
name: Publish to Github | |
needs: create_release | |
permissions: | |
contents: write | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use node.js lts | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Setup node_modules | |
working-directory: ./ui | |
run: yarn install --frozen-lockfile | |
- name: Build UI | |
working-directory: ./ui | |
run: yarn build | |
- name: Get latest release version number | |
id: get_version | |
run: echo "version-without-v=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" | |
- name: Set version | |
run: | | |
echo ${{ steps.get_version.outputs.version-without-v }} > ezbeq/VERSION | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --with exe --no-interaction --no-root | |
- name: Install project | |
run: poetry install --with exe --no-interaction | |
- name: Create distribution | |
id: create_dist | |
run: | | |
poetry run pyinstaller --clean --log-level=INFO ezbeq.spec | |
if [[ "$RUNNER_OS" == "macOS" ]] | |
then | |
pushd dist | |
rm ezbeq | |
zip -r ezbeq.app.zip ezbeq.app | |
rm -Rf ezbeq.app | |
popd | |
echo "binary_path=dist/ezbeq.app.zip" >> $GITHUB_OUTPUT | |
echo "binary_name=ezbeq.app.zip" >> $GITHUB_OUTPUT | |
echo "binary_content_type=application.zip" >> $GITHUB_OUTPUT | |
elif [[ "$RUNNER_OS" == "Windows" ]] | |
then | |
echo "binary_path=dist/ezbeq.exe" >> $GITHUB_OUTPUT | |
echo "binary_name=ezbeq.exe" >> $GITHUB_OUTPUT | |
echo "binary_content_type=application.vnd.microsoft.portable-executable" >> $GITHUB_OUTPUT | |
fi | |
- name: Upload asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ github.ref_name }} ${{ steps.create_dist.outputs.binary_path }} |