Skip to content

Merge with cu_manager detector #12

Merge with cu_manager detector

Merge with cu_manager detector #12

# This workflow deploys battery cycler datatypes|cu_manager|db_sync to development environment
name: Publish DATATYPES|CU_MANAGER|DB_SYNC package - STAGING
on:
push:
branches:
- 'datatypes'
- 'cu_manager'
- 'db_sync'
pull_request_review:
types: [submitted]
jobs:
build-package-on-push:
name: QA and Build ${{ vars.PREFIX_PACKAGE_NAME }}${{ github.ref_name }} on push
if: ${{ github.event_name == 'push' }}
uses: WattRex/System-Tools/.github/workflows/build_python_package.yml@develop
with:
package-name: ${{ vars.PREFIX_PACKAGE_NAME }}${{ github.ref_name }}
package-path: "code/${{ github.ref_name }}"
source-path: "code/${{ github.ref_name }}/src/${{ vars.PREFIX_PACKAGE_NAME }}${{ github.ref_name }}"
python-version: "3.10"
build-package-on-pull-request:
name: QA and Build ${{ vars.PREFIX_PACKAGE_NAME }}${{ github.event.pull_request.head.ref }} on pull request
if: ${{ github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && contains(fromJson(vars.PACKAGES_BRANCHES), github.event.pull_request.head.ref) }}
uses: WattRex/System-Tools/.github/workflows/build_python_package.yml@develop
with:
package-name: ${{ vars.PREFIX_PACKAGE_NAME }}${{ github.event.pull_request.head.ref }}
package-path: "code/${{ github.event.pull_request.head.ref }}"
source-path: "code/${{ github.event.pull_request.head.ref }}/src/${{ vars.PREFIX_PACKAGE_NAME }}${{ github.event.pull_request.head.ref }}"
python-version: "3.10"
publish-package:
name: Publish package ${{ vars.PREFIX_PACKAGE_NAME }}${{ github.event.pull_request.head.ref }} to PyPi
needs: build-package-on-pull-request
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: ${{ vars.PREFIX_PACKAGE_NAME }}${{ github.event.pull_request.head.ref }}
path: ${{ github.event.pull_request.head.ref }}/dist/
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e #realse/v1.8.10
with:
verbose: true
repository-url: https://test.pypi.org/legacy/
packages-dir: ${{ github.event.pull_request.head.ref }}/dist/