redo menu/bottom nav #136
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 | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: pytest | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
pipenv install -d | |
PYTHONPATH=. pipenv run pytest --cov=./ezbeq --cov-report=xml | |
- name: Generate changelog | |
id: changelog | |
uses: metcalfc/changelog-generator@v4.0.1 | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
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 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use node.js lts | |
uses: actions/setup-node@v3 | |
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: Copy UI to Server | |
run: | | |
rm -Rf ezbeq/ui | |
mv ui/build ezbeq/ui | |
- name: Get latest release version number | |
id: get_version | |
uses: battila7/get-version-action@v2 | |
- name: Set version | |
run: | | |
echo ${{ steps.get_version.outputs.version-without-v }} > ezbeq/VERSION | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
pip install wheel | |
pipenv install -d | |
pip list | |
pipenv run pip list | |
- name: Build dist | |
run: python setup.py sdist bdist_wheel | |
- name: Publish a Python distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
buildpyinstaller: | |
name: Publish to Github | |
needs: create_release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use node.js lts | |
uses: actions/setup-node@v3 | |
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 | |
uses: battila7/get-version-action@v2 | |
- name: Set version | |
run: | | |
echo ${{ steps.get_version.outputs.version-without-v }} > ezbeq/VERSION | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
pipenv --python 3.8 install -d | |
pipenv run pip install pyinstaller | |
pip list | |
pipenv run pip list | |
- name: Create distribution | |
id: create_dist | |
run: | | |
pipenv 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 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_name: ${{ steps.create_dist.outputs.binary_name }} | |
asset_path: ${{ steps.create_dist.outputs.binary_path }} | |
asset_content_type: ${{ steps.create_dist.outputs.binary_content_type }} |