Skip to content

Release Photons core #37

Release Photons core

Release Photons core #37

Workflow file for this run

on:
- workflow_dispatch
name: Release Photons core
jobs:
build:
name: Create the package
runs-on: ubuntu-latest
environment: github_release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- id: build
run: cd modules && pip install hatch==1.6.3 && hatch build
- id: version
run: |
VERSION=$(python -c "import runpy; print(runpy.run_path('modules/photons_app/__init__.py')['VERSION'])")
VERSIONDASH=$(python -c "import runpy; print(runpy.run_path('modules/photons_app/__init__.py')['VERSION'].replace('.', '-'))")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "versiondash=$VERSIONDASH" >> $GITHUB_OUTPUT
- id: package
run: >
echo "package=lifx_photons_core-${{ steps.version.outputs.version }}.tar.gz" >> $GITHUB_OUTPUT
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "release-core-${{ steps.version.outputs.version }}"
release_name: Photons Core ${{ steps.version.outputs.version }}
body: "http://photons.delfick.com/changelog.html#release-core-${{ steps.version.outputs.versiondash }}"
draft: false
prerelease: false
- id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "modules/dist/${{ steps.package.outputs.package }}"
asset_name: ${{ steps.package.outputs.package }}
asset_content_type: application/tar+gzip
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_CORE }}
packages_dir: modules/dist