diff --git a/.github/workflows/queasars_deploy_to_pypi.yml b/.github/workflows/queasars_deploy_to_pypi.yml index e930fdf..5131e2c 100644 --- a/.github/workflows/queasars_deploy_to_pypi.yml +++ b/.github/workflows/queasars_deploy_to_pypi.yml @@ -36,5 +36,5 @@ jobs: env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} run: | - poetry config pypi-token.pypi "PYPI_TOKEN" - poetry publish -r pypi --build \ No newline at end of file + poetry config pypi-token.pypi "$PYPI_TOKEN" + poetry publish --build \ No newline at end of file diff --git a/.github/workflows/queasars_deployment.yml b/.github/workflows/queasars_deployment.yml index 8693957..8051faf 100644 --- a/.github/workflows/queasars_deployment.yml +++ b/.github/workflows/queasars_deployment.yml @@ -11,16 +11,16 @@ on: workflow_dispatch: inputs: version: - description: 'Version of the release in the form: vX.Y.Z' + description: 'Release version in the form: vX.Y.Z' type: string required: true deploy_to_pypi: - description: 'Boolean value indicating whether QUEASARS should be deployed to PyPI.' + description: 'Deploy to PyPI.' type: boolean required: false default: true deploy_to_pages: - description: 'Boolean value indicating whether QUEASARS documentation should be deployed to GitHub Pages.' + description: 'Deploy to GitHub Pages.' type: boolean required: false default: true @@ -36,13 +36,15 @@ jobs: name: Check Version Consistency runs-on: ubuntu-latest steps: - - if: ${{ inputs.version != '' }} + - if: ${{ github.event_name == 'workflow_dispatch' }} name: Check workflow version input shell: bash + env: + VERSION_INPUT: ${{ inputs.version }} run: | - if [[ $inputs.version != @(v[0-9].[0-9].[0-9]) ]]; then exit 1; fi - echo "VERSION=${inputs.version:1}" >> $GITHUB_ENV - - if: ${{ inputs.version == '' }} + if [[ $VERSION_INPUT != @(v[0-9].[0-9].[0-9]) ]]; then exit 1; fi + echo "VERSION=${VERSION_INPUT:1}" >> $GITHUB_ENV + - if: ${{ github.event_name == 'push' }} name: Get tag version shell: bash env: @@ -82,7 +84,7 @@ jobs: # Only deploy to PyPI if both the project version is consistent and the CI is run successfully. name: Deploy to PyPI needs: [Check_Version_Consistency, Run_CI] - if: ${{ inputs.deploy_to_pypi == '' || inputs.deploy_to_pypi == true }} + if: ${{ github.event_name == 'push' || inputs.deploy_to_pypi }} uses: ./.github/workflows/queasars_deploy_to_pypi.yml secrets: inherit @@ -90,5 +92,9 @@ jobs: # Only deploy to GitHub Pages if the deployment to PyPI succeeded. name: Deploy to Github Pages needs: Deploy_To_PyPI - if: ${{ inputs.deploy_to_pages == '' || inputs.deploy_to_pages == true }} + if: | + always() && + !cancelled() && + !failure() && + ( github.event_name == 'push' || inputs.deploy_to_pages ) uses: ./.github/workflows/queasars_deploy_documentation.yml \ No newline at end of file