diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a32917..d856e2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,10 +8,23 @@ on: workflow_dispatch: inputs: publish-release: + description: "Publish Release" + required: false + type: boolean + default: false + production-release: description: "Production Release" required: false type: boolean default: false + increment-version: + description: "Increment Version" + required: false + type: choice + options: + - patch + - minor + - major jobs: build: runs-on: ubuntu-latest @@ -44,8 +57,9 @@ jobs: jlpm run test - name: Increment the Version + if: ${{ inputs.increment-version }} run: | - hatch version patch + hatch version ${{ inputs.increment-version }} # Commit all changed files back to the repository - uses: stefanzweifel/git-auto-commit-action@v5 @@ -61,16 +75,17 @@ jobs: sed -i 's/"@quarto\/jupyterlab-quarto"/"jupyterlab-quarto"/g' package.json python -m build sed -i 's/"jupyterlab-quarto"/"@quarto\/jupyterlab-quarto"/g' package.json - + jlpm + - name: Publish package distributions to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 - if: ${{ ! inputs.publish-release }} + if: ${{ publish-release && ! inputs.production-release }} with: repository-url: https://test.pypi.org/legacy/ - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - if: ${{ inputs.publish-release }} + if: ${{ publish-release && inputs.production-release }} - name: Build the NPM Front End run: | @@ -80,4 +95,4 @@ jobs: - uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} - if: ${{ inputs.publish-release }} + if: ${{ publish-release && inputs.production-release }}