Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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