Skip to content

Commit

Permalink
new ci/cd pipeline connecting package release to api deploy - attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
iperoyg committed Jun 26, 2022
1 parent 0418e92 commit d0d57ed
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
build:
uses: ./.github/workflows/package-code-check.yml
uses: ./.github/workflows/1_1-package-code-check.yml
secrets: inherit

release:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Package Check
name: Package Code Check

on:
workflow_call:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/2_0-package-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Publish Python Package to Pypi

name: PreRelease on PyPi

on:
release:
types: [prereleased]

jobs:

publish:
uses: ./.github/workflows/2_1-package-publish-on-pypi.yml
with:
tag_name: ${{ github.event.release.tag_name }}
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/2_0-package-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Publish Python Package to Pypi

name: Package Release

on:
release:
types: [released]

jobs:

publish:
uses: ./.github/workflows/2_1-package-publish-on-pypi.yml
with:
tag_name: ${{ github.event.release.tag_name }}
secrets: inherit
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@
name: Publish on PyPi

on:
release:
types: [published]
workflow_call:
inputs:
tag_name:
required: true
type: string

jobs:

publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Check release
run: |
echo ${{ github.event.release.tag_name }}
echo ${{ inputs.tag_name }}
- name: Fetch Github Release Asset
uses: dsaltares/[email protected]
with:
regex: true
file: "complexoperations.*"
target: "dist/"
version: tags/${{ github.event.release.tag_name }}
version: tags/${{ inputs.tag_name }}
token: ${{ secrets.MY_TOKEN }}
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Publish Python Package to Test Pypi

name: Publish on TestPypi

on: workflow_dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Package to API CD

on:
workflow_run:
workflows: [Publish on PyPi]
workflows: [Package Release]
types: [completed]

jobs:
Expand Down

0 comments on commit d0d57ed

Please sign in to comment.