|
1 | 1 | name: Release Tag |
2 | | -if: github.actor == 'lpoulter' |
3 | 2 |
|
4 | 3 | on: |
5 | 4 | workflow_dispatch: |
6 | 5 | inputs: |
7 | 6 | release_type: |
8 | | - description: 'Semantic version bump to apply before tagging' |
| 7 | + description: "Semantic version bump to apply before tagging" |
9 | 8 | required: true |
10 | 9 | type: choice |
11 | 10 | default: patch |
|
14 | 13 | - minor |
15 | 14 | - major |
16 | 15 | release_notes: |
17 | | - description: 'Release notes for the GitHub release' |
| 16 | + description: "Release notes for the GitHub release" |
18 | 17 | required: false |
19 | | - default: '' |
| 18 | + default: "" |
20 | 19 |
|
21 | 20 | jobs: |
22 | 21 | bump: |
23 | 22 | runs-on: ubuntu-latest |
| 23 | + if: github.actor == 'siliconlad' |
24 | 24 | permissions: write-all |
25 | 25 | steps: |
26 | 26 | - uses: actions/checkout@v4 |
27 | 27 | with: |
28 | | - ref: 'main' |
| 28 | + ref: "main" |
29 | 29 |
|
30 | 30 | - name: Install uv |
31 | 31 | uses: astral-sh/setup-uv@v6 |
@@ -84,60 +84,62 @@ jobs: |
84 | 84 |
|
85 | 85 | release: |
86 | 86 | runs-on: ubuntu-latest |
| 87 | + if: github.actor == 'siliconlad' |
87 | 88 | needs: [bump] |
88 | 89 | permissions: |
89 | 90 | contents: write |
90 | 91 | steps: |
91 | | - - uses: actions/checkout@v4 |
92 | | - with: |
93 | | - ref: 'main' # Checkout main branch with updated commit |
94 | | - |
95 | | - - name: Install uv |
96 | | - uses: astral-sh/setup-uv@v6 |
97 | | - with: |
98 | | - version: latest |
99 | | - |
100 | | - - name: Get version |
101 | | - id: version |
102 | | - shell: bash |
103 | | - run: | |
104 | | - set -euo pipefail |
105 | | - echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT" |
106 | | - echo "tag=v$(uv version --short)" >> "$GITHUB_OUTPUT" |
107 | | -
|
108 | | - - name: Create GitHub release |
109 | | - uses: softprops/action-gh-release@v2 |
110 | | - with: |
111 | | - target_commitish: main |
112 | | - tag_name: ${{ steps.version.outputs.tag }} |
113 | | - name: ${{ steps.version.outputs.tag }} |
114 | | - body: ${{ inputs.release_notes }} |
115 | | - generate_release_notes: true |
116 | | - make_latest: true |
117 | | - env: |
118 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 92 | + - uses: actions/checkout@v4 |
| 93 | + with: |
| 94 | + ref: "main" # Checkout main branch with updated commit |
| 95 | + |
| 96 | + - name: Install uv |
| 97 | + uses: astral-sh/setup-uv@v6 |
| 98 | + with: |
| 99 | + version: latest |
| 100 | + |
| 101 | + - name: Get version |
| 102 | + id: version |
| 103 | + shell: bash |
| 104 | + run: | |
| 105 | + set -euo pipefail |
| 106 | + echo "version=$(uv version --short)" >> "$GITHUB_OUTPUT" |
| 107 | + echo "tag=v$(uv version --short)" >> "$GITHUB_OUTPUT" |
| 108 | +
|
| 109 | + - name: Create GitHub release |
| 110 | + uses: softprops/action-gh-release@v2 |
| 111 | + with: |
| 112 | + target_commitish: main |
| 113 | + tag_name: ${{ steps.version.outputs.tag }} |
| 114 | + name: ${{ steps.version.outputs.tag }} |
| 115 | + body: ${{ inputs.release_notes }} |
| 116 | + generate_release_notes: true |
| 117 | + make_latest: true |
| 118 | + env: |
| 119 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
119 | 120 |
|
120 | 121 | publish: |
121 | 122 | runs-on: ubuntu-latest |
| 123 | + if: github.actor == 'siliconlad' |
122 | 124 | environment: pypi |
123 | 125 | permissions: |
124 | 126 | id-token: write |
125 | 127 | contents: write |
126 | 128 | steps: |
127 | | - - uses: actions/checkout@v4 |
| 129 | + - uses: actions/checkout@v4 |
128 | 130 |
|
129 | | - - name: Install uv |
130 | | - uses: astral-sh/setup-uv@v3 |
131 | | - with: |
132 | | - version: "latest" |
| 131 | + - name: Install uv |
| 132 | + uses: astral-sh/setup-uv@v3 |
| 133 | + with: |
| 134 | + version: "latest" |
133 | 135 |
|
134 | | - - name: Build package |
135 | | - run: uv build --no-sources |
| 136 | + - name: Build package |
| 137 | + run: uv build --no-sources |
136 | 138 |
|
137 | | - - name: Upload to GitHub Release |
138 | | - uses: softprops/action-gh-release@v2 |
139 | | - with: |
140 | | - files: dist/* |
| 139 | + - name: Upload to GitHub Release |
| 140 | + uses: softprops/action-gh-release@v2 |
| 141 | + with: |
| 142 | + files: dist/* |
141 | 143 |
|
142 | | - - name: Publish to PyPI |
143 | | - run: uv publish |
| 144 | + - name: Publish to PyPI |
| 145 | + run: uv publish |
0 commit comments