|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - EC-gha-to-publish-package-to-testpypi |
7 | | - workflow_dispatch: |
8 | | - inputs: |
9 | | - tag_name: |
10 | | - description: "Release tag (e.g., v1.0.1)" |
11 | | - required: true |
12 | | - type: string |
13 | | - dry_run: |
14 | | - description: "Dry Run? (Skip the actual upload)" |
15 | | - required: true |
16 | | - type: boolean |
17 | | - default: true |
| 7 | + # This to be used for live instead of on branch: |
| 8 | + # tags: |
| 9 | + # - '[0-9]*' # Triggers on tags like 10.0.1 |
| 10 | +# workflow_dispatch: |
| 11 | +# inputs: |
| 12 | +# tag_name: |
| 13 | +# description: "Release tag (e.g., 10.0.1)" |
| 14 | +# required: true |
| 15 | +# type: string |
| 16 | +# dry_run: |
| 17 | +# description: "Dry Run? (Skip the actual upload)" |
| 18 | +# required: true |
| 19 | +# type: boolean |
| 20 | +# default: true |
18 | 21 |
|
19 | 22 | jobs: |
20 | | - upload: |
| 23 | + publish: |
21 | 24 | runs-on: ubuntu-latest |
22 | 25 | environment: testpypi |
23 | 26 | permissions: |
24 | | - id-token: write |
| 27 | + id-token: write # Needed for Trusted Publishing |
25 | 28 | contents: read |
26 | 29 |
|
27 | 30 | steps: |
28 | | - - name: Checkout Code |
| 31 | + - name: Checkout Code at Tag |
29 | 32 | uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + # Hardcoded for testing. |
| 35 | + ref: "10.0.1" |
30 | 36 |
|
31 | | - - name: Debug List Releases |
32 | | - env: |
33 | | - GH_TOKEN: ${{ github.token }} |
34 | | - run: gh release list |
| 37 | + - name: Set up Python |
| 38 | + uses: actions/setup-python@v5 |
| 39 | + with: |
| 40 | + python-version: "3.x" |
35 | 41 |
|
36 | | - # - name: Download Release Assets |
37 | | - # env: |
38 | | - # GH_TOKEN: ${{ github.token }} |
39 | | - # run: | |
40 | | - # mkdir dist |
41 | | - # gh release download 10.0.1 -R ${{ github.repository }} --dir dist --pattern "*" |
| 42 | + - name: Re-build Wheel |
| 43 | + run: | |
| 44 | + pip install wheel |
| 45 | + python setup.py bdist_wheel |
42 | 46 |
|
43 | | -# - name: List files to verify |
44 | | -# run: ls -R dist/ |
45 | | -# |
46 | | -# - name: Publish to TestPyPI |
47 | | -# uses: pypa/gh-action-pypi-publish@release/v1 |
48 | | -# with: |
49 | | -# repository-url: https://test.pypi.org/legacy/ |
50 | | -# dry-run: true |
| 47 | + - name: Publish to TestPyPI |
| 48 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 49 | + with: |
| 50 | + repository-url: https://test.pypi.org/legacy/ |
| 51 | + dry-run: true |
0 commit comments