more logging, send MC state to mqtt #57
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.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
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: 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: 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 }} > cmdserver/VERSION | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
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 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- uses: octokit/request-action@v2.x | |
with: | |
route: POST /repos/{owner}/{repo}/dispatches | |
owner: 3ll3d00d | |
repo: cmdserver-image | |
event_type: 'trigger' | |
env: | |
GITHUB_TOKEN: ${{ secrets.CMDSERVERIMG }} | |
buildpyinstaller: | |
name: Publish to Github | |
needs: create_release | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ windows-latest ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 }} > cmdserver/VERSION | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
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 cmdserver.spec | |
echo "binary_path=dist/cmdserver.exe" >> $GITHUB_OUTPUT | |
echo "binary_name=cmdserver.exe" >> $GITHUB_OUTPUT | |
echo "binary_content_type=application.vnd.microsoft.portable-executable" >> $GITHUB_OUTPUT | |
- 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 }} |