Skip to content

Commit e0b7883

Browse files
authored
Fix releaser.yml (#1331)
Signed-off-by: paul.profizi <[email protected]>
1 parent fe42da5 commit e0b7883

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

.github/workflows/ansys_lab.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55
workflow_call:
66
inputs:
77
version:
8-
description: "Release version as 'X.Y.Z'"
8+
description: "Release version as 'vX.Y.Z'"
99
type: string
1010
required: true
1111
# Can be called manually
1212
workflow_dispatch:
1313
inputs:
1414
version:
15-
description: "Release version as 'X.Y.Z'"
15+
description: "Release version as 'vX.Y.Z'"
1616
type: string
1717
required: true
1818

@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
file: HTML-doc-ansys-dpf-core.zip
4545
token: ${{ secrets.GITHUB_TOKEN }}
46-
version: tags/v${{ inputs.version }}
46+
version: tags/${{ inputs.version }}
4747

4848
- name: "Extract ipynb examples"
4949
shell: python

.github/workflows/releaser.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,34 @@ env:
2222

2323
jobs:
2424

25+
get_latest_tag:
26+
name: "Get latest release version tag"
27+
runs-on: ubuntu-latest
28+
outputs:
29+
version: ${{ steps.step1.outputs.version }}
30+
steps:
31+
- id: step1
32+
name: "Get version tag"
33+
shell: bash
34+
run: |
35+
get_latest_release() {
36+
curl --silent "https://api.github.com/repos/$1/releases/latest" |
37+
grep '"tag_name":' |
38+
sed -E 's/.*"([^"]+)".*/\1/'
39+
}
40+
version=$(get_latest_release "ansys/pydpf-core")
41+
echo $version
42+
echo "version=$version" >> "$GITHUB_OUTPUT"
43+
2544
Publish_to_PyPI:
2645
name: "Publish Release to PyPI"
2746
runs-on: ubuntu-latest
47+
needs: get_latest_tag
2848
steps:
2949
- name: "Download Release Assets"
3050
uses: robinraju/[email protected]
3151
with:
32-
tag: ${{ github.event.inputs.release_tag || 'latest' }}
52+
tag: ${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }}
3353
fileName: "*.whl"
3454
tarBall: false
3555
zipBall: false
@@ -55,6 +75,7 @@ jobs:
5575
with:
5676
file: HTML-doc-ansys-dpf-core.zip
5777
token: ${{ secrets.GITHUB_TOKEN }}
78+
version: tags/${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }}
5879

5980
- name: "List downloaded assets"
6081
shell: bash
@@ -111,6 +132,7 @@ jobs:
111132

112133
update_ansys_lab_examples:
113134
uses: ./.github/workflows/ansys_lab.yml
135+
needs: get_latest_tag
114136
with:
115-
version: ${{ github.event.inputs.release_tag || 'latest' }}
137+
version: ${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }}
116138
secrets: inherit

0 commit comments

Comments
 (0)