Dry run version on push to my branch only. #1
This file contains hidden or 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: On push to branch dry-run publish. | |
| on: | |
| push: | |
| branches: | |
| - EC-gha-to-publish-package-to-testpypi | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| description: "Release tag (e.g., v1.0.1)" | |
| required: true | |
| type: string | |
| dry_run: | |
| description: "Dry Run? (Skip the actual upload)" | |
| required: true | |
| type: boolean | |
| default: true | |
| jobs: | |
| upload: | |
| runs-on: ubuntu-latest | |
| environment: testpypi | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Download Release Assets | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| mkdir dist | |
| gh release download 10.0.1 --dir dist --pattern "*" | |
| - name: List files to verify | |
| run: ls -R dist/ | |
| - name: Publish to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| dry-run: true |