|
7 | 7 | workflow_dispatch: |
8 | 8 | inputs: |
9 | 9 | version: |
10 | | - description: 'Version to release (e.g., 0.1.0)' |
| 10 | + description: 'Version to release (e.g., 0.1.5)' |
11 | 11 | required: true |
12 | 12 | type: string |
13 | 13 |
|
@@ -65,52 +65,61 @@ jobs: |
65 | 65 | name: dist |
66 | 66 | path: dist/ |
67 | 67 |
|
68 | | - # publish: |
69 | | - # needs: build |
70 | | - # runs-on: ubuntu-latest |
71 | | - # permissions: |
72 | | - # id-token: write # IMPORTANT: this permission is mandatory for trusted publishing |
73 | | - # steps: |
74 | | - # - name: Download build artifacts |
75 | | - # uses: actions/download-artifact@v4 |
76 | | - # with: |
77 | | - # name: dist |
78 | | - # path: dist/ |
79 | | - # |
80 | | - # - name: Publish to PyPI |
81 | | - # uses: pypa/gh-action-pypi-publish@release/v1 |
82 | | - # # Uncomment when ready to publish to PyPI |
83 | | - # # with: |
84 | | - # # password: ${{ secrets.PYPI_API_TOKEN }} |
85 | | - # # Or use trusted publishing (recommended): |
86 | | - # # with: |
87 | | - # # repository-url: https://upload.pypi.org/legacy/ |
88 | | - |
89 | | - # create-release: |
90 | | - # needs: build |
91 | | - # runs-on: ubuntu-latest |
92 | | - # permissions: |
93 | | - # contents: write |
94 | | - # steps: |
95 | | - # - uses: actions/checkout@v4 |
96 | | - # with: |
97 | | - # fetch-depth: 0 |
98 | | - |
99 | | - # - name: Create GitHub Release |
100 | | - # uses: ncipollo/release-action@v1 |
101 | | - # with: |
102 | | - # tag: ${{ github.ref_name }} |
103 | | - # name: Release ${{ github.ref_name }} |
104 | | - # body: | |
105 | | - # ## Changes |
106 | | - |
107 | | - # - See [CHANGELOG.md](CHANGELOG.md) for detailed changes |
108 | | - |
109 | | - # ## Installation |
110 | | - |
111 | | - # ```bash |
112 | | - # pip install fastwoe==${{ github.ref_name }} |
113 | | - # ``` |
114 | | - # draft: false |
115 | | - # prerelease: false |
116 | | - # token: ${{ secrets.GITHUB_TOKEN }} |
| 68 | + publish: |
| 69 | + needs: build |
| 70 | + runs-on: ubuntu-latest |
| 71 | + steps: |
| 72 | + - name: Download build artifacts |
| 73 | + uses: actions/download-artifact@v4 |
| 74 | + with: |
| 75 | + name: dist |
| 76 | + path: dist/ |
| 77 | + |
| 78 | + - name: Publish to PyPI |
| 79 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 80 | + with: |
| 81 | + password: ${{ secrets.PYPI_API_TOKEN }} |
| 82 | + |
| 83 | + create-release: |
| 84 | + needs: build |
| 85 | + runs-on: ubuntu-latest |
| 86 | + permissions: |
| 87 | + contents: write |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v4 |
| 90 | + with: |
| 91 | + fetch-depth: 0 |
| 92 | + |
| 93 | + - name: Extract version from tag |
| 94 | + id: get_version |
| 95 | + run: | |
| 96 | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then |
| 97 | + echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT |
| 98 | + echo "tag=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT |
| 99 | + else |
| 100 | + echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT |
| 101 | + echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT |
| 102 | + fi |
| 103 | +
|
| 104 | + - name: Create GitHub Release |
| 105 | + uses: ncipollo/release-action@v1 |
| 106 | + with: |
| 107 | + tag: ${{ steps.get_version.outputs.tag }} |
| 108 | + name: Release ${{ steps.get_version.outputs.tag }} |
| 109 | + body: | |
| 110 | + ## Changes |
| 111 | +
|
| 112 | + See [CHANGELOG.md](https://github.com/xRiskLab/fastwoe/blob/main/CHANGELOG.md) for detailed changes. |
| 113 | +
|
| 114 | + ## Installation |
| 115 | +
|
| 116 | + ```bash |
| 117 | + pip install fastwoe==${{ steps.get_version.outputs.version }} |
| 118 | + ``` |
| 119 | +
|
| 120 | + ## What's New in v${{ steps.get_version.outputs.version }} |
| 121 | +
|
| 122 | + Check the [CHANGELOG](https://github.com/xRiskLab/fastwoe/blob/main/CHANGELOG.md#version-${{ steps.get_version.outputs.version }}) for full details. |
| 123 | + draft: false |
| 124 | + prerelease: false |
| 125 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments