Skip to content

Commit

Permalink
Fix releaser.yml
Browse files Browse the repository at this point in the history
Signed-off-by: paul.profizi <[email protected]>
  • Loading branch information
PProfizi committed Dec 14, 2023
1 parent 22a8db4 commit 51b8260
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ansys_lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
workflow_call:
inputs:
version:
description: "Release version as 'X.Y.Z'"
description: "Release version as 'vX.Y.Z'"
type: string
required: true
# Can be called manually
workflow_dispatch:
inputs:
version:
description: "Release version as 'X.Y.Z'"
description: "Release version as 'vX.Y.Z'"
type: string
required: true

Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
with:
file: HTML-doc-ansys-dpf-core.zip
token: ${{ secrets.GITHUB_TOKEN }}
version: tags/v${{ inputs.version }}
version: tags/${{ inputs.version }}

- name: "Extract ipynb examples"
shell: python
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,34 @@ env:

jobs:

get_latest_tag:
name: "Get latest release version tag"
runs-on: ubuntu-latest
outputs:
version: ${{ steps.step1.outputs.version }}
steps:
- id: step1
name: "Get version tag"
shell: bash
run: |
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" |
grep '"tag_name":' |
sed -E 's/.*"([^"]+)".*/\1/'
}
version=$(get_latest_release "ansys/pydpf-core")
echo $version
echo "version=$version" >> "$GITHUB_OUTPUT"
Publish_to_PyPI:
name: "Publish Release to PyPI"
runs-on: ubuntu-latest
needs: get_latest_tag
steps:
- name: "Download Release Assets"
uses: robinraju/[email protected]
with:
tag: ${{ github.event.inputs.release_tag || 'latest' }}
tag: ${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }}
fileName: "*.whl"
tarBall: false
zipBall: false
Expand All @@ -55,6 +75,7 @@ jobs:
with:
file: HTML-doc-ansys-dpf-core.zip
token: ${{ secrets.GITHUB_TOKEN }}
version: tags/${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }}

- name: "List downloaded assets"
shell: bash
Expand Down Expand Up @@ -111,6 +132,7 @@ jobs:

update_ansys_lab_examples:
uses: ./.github/workflows/ansys_lab.yml
needs: get_latest_tag
with:
version: ${{ github.event.inputs.release_tag || 'latest' }}
version: ${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }}
secrets: inherit

0 comments on commit 51b8260

Please sign in to comment.