Skip to content

Release Photons core #39

Release Photons core

Release Photons core #39

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
permissions:
# for trusted publishing
id-token: write
# for creating the release
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- id: build
run: cd modules && ../tools/uv build -o dist
- 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 }}
- id: create-release
uses: softprops/action-gh-release@v2
with:
name: Photons Core ${{ steps.version.outputs.version }}
body: "http://photons.delfick.com/changelog.html#release-core-${{ steps.version.outputs.versiondash }}"
tag_name: "release-core-${{ steps.version.outputs.version }}"
fail_on_unmatched_files: true
draft: false
prerelease: false
files: "dist/*"
- name: publish
uses: pypa/gh-action-pypi-publish@release/v1