Skip to content

Commit

Permalink
Add new workflow to mn_manager to publish on Test Pypi and disable pr…
Browse files Browse the repository at this point in the history
…evious workflow
  • Loading branch information
javibu13 committed Dec 1, 2023
1 parent 2ff1c58 commit c6ce076
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/deploy_development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow deploy system tools to development environment

name: deploy DEVELOPMENT

on:
push:
branches: [ "mn_manager" ]

pull_request_review:
types: [submitted]
review:
pull_request:
head:
ref: [ "mn_manager" ]

jobs:

build-package-on-push:
if: ${{ github.event_name == 'push'}}
name: Build package ${{ vars.MN_MANAGER_PACKAGE_NAME }}
uses: WattRex/System-Tools/.github/workflows/build_python_package.yml@develop
with:
package-name: ${{ vars.MN_MANAGER_PACKAGE_NAME }}
package-path: mn_manager
source-path: mn_manager/src/wattrex_mn_manager
python-version: "3.10"
is-test-package: false

build-package-on-pull-request:
if: ${{ github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && github.event.pull_request.head.ref == 'mn_manager'}}
name: Build package ${{ vars.MN_MANAGER_PACKAGE_NAME }}
uses: WattRex/System-Tools/.github/workflows/build_python_package.yml@develop
with:
package-name: ${{ vars.MN_MANAGER_PACKAGE_NAME }}
package-path: mn_manager
source-path: mn_manager/src/wattrex_mn_manager
python-version: "3.10"
is-test-package: false

publish-package:
name: Publish package ${{ vars.MN_MANAGER_PACKAGE_NAME }} to Test PyPi
needs: build-package-on-pull-request
runs-on: ubuntu-latest
environment: development
permissions:
id-token: write

steps:
- name: Download a single artifact
uses: actions/download-artifact@v3
with:
name: ${{ vars.MN_MANAGER_PACKAGE_NAME }}
path: ${{ vars.MN_MANAGER_PACKAGE_NAME }}/dist/

- name: Publish package to Test PyPI
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e #realse/v1.8.10
with:
verbose: true
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
packages-dir: "${{ vars.MN_MANAGER_PACKAGE_NAME }}/dist/"
2 changes: 1 addition & 1 deletion .github/workflows/publish-mn-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Master node manager QA and deploy to Pypi

on:
#on:
push:
branches: [ "mn_manager" ]

Expand Down

0 comments on commit c6ce076

Please sign in to comment.