v0.9.2 #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
release: | |
types: [published] | |
# Can be called manually | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: 'Release tag' | |
default: 'latest' | |
type: string | |
env: | |
DOCUMENTATION_CNAME: 'post.docs.pyansys.com' | |
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-post") | |
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/release-downloader@v1.11 | |
with: | |
tag: ${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }} | |
fileName: "*.whl" | |
tarBall: false | |
zipBall: false | |
out-file-path: "assets" | |
extract: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: "Upload to Public PyPI" | |
run: | | |
pip install twine | |
twine upload --skip-existing assets/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
upload_docs_release: | |
name: "Upload release documentation" | |
needs: [Publish_to_PyPI, get_latest_tag] | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Download Release Asset - HTML" | |
uses: dsaltares/fetch-gh-release-asset@1.1.2 | |
with: | |
file: HTML-doc-ansys-dpf-post.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
version: ${{ github.event.inputs.release_tag && format('tags/{0}', github.event.inputs.release_tag) || format('tags/{0}', needs.get_latest_tag.outputs.version) }} | |
- name: "List downloaded assets" | |
shell: bash | |
run: | | |
ls | |
- name: "Upload artifact" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: HTML-doc-ansys-dpf-post.zip | |
path: HTML-doc-ansys-dpf-post.zip | |
- name: "Deploy the stable documentation" | |
uses: ansys/actions/doc-deploy-stable@v8 | |
with: | |
cname: ${{ env.DOCUMENTATION_CNAME }} | |
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} | |
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} | |
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} | |
doc-artifact-name: HTML-doc-ansys-dpf-post.zip | |
decompress-artifact: true | |
update_ansys_lab_examples: | |
uses: ./.github/workflows/ansys_lab.yml | |
needs: get_latest_tag | |
with: | |
version: ${{ github.event.inputs.release_tag || needs.get_latest_tag.outputs.version }} | |
secrets: inherit |