|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "ci" |
| 7 | + |
4 | 8 | pull_request: |
5 | 9 | branches: |
6 | 10 | - "master" |
|
10 | 14 | - "httptools/_version.py" |
11 | 15 |
|
12 | 16 | jobs: |
13 | | - validate-release-request: |
14 | | - runs-on: ubuntu-latest |
15 | | - steps: |
16 | | - - name: Validate release PR |
17 | | - uses: edgedb/action-release/validate-pr@bae6b9134e872166b43d218dd79397c851c41c9a |
18 | | - id: checkver |
19 | | - with: |
20 | | - require_team: Release Managers |
21 | | - require_approval: no |
22 | | - github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} |
23 | | - version_file: httptools/_version.py |
24 | | - version_line_pattern: | |
25 | | - __version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"]) |
26 | | -
|
27 | | - - name: Stop if not approved |
28 | | - if: steps.checkver.outputs.approved != 'true' |
29 | | - run: | |
30 | | - echo ::error::PR is not approved yet. |
31 | | - exit 1 |
32 | | -
|
33 | | - - name: Store release version for later use |
34 | | - env: |
35 | | - VERSION: ${{ steps.checkver.outputs.version }} |
36 | | - run: | |
37 | | - mkdir -p dist/ |
38 | | - echo "${VERSION}" > dist/VERSION |
39 | | -
|
40 | | - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 |
41 | | - with: |
42 | | - name: dist-version |
43 | | - path: dist/ |
44 | | - |
45 | 17 | build-sdist: |
46 | | - needs: validate-release-request |
47 | 18 | runs-on: ubuntu-latest |
48 | 19 |
|
49 | 20 | steps: |
|
65 | 36 | path: dist/*.tar.* |
66 | 37 |
|
67 | 38 | build-wheels: |
68 | | - needs: validate-release-request |
69 | 39 | runs-on: ${{ matrix.os }} |
70 | 40 | strategy: |
71 | 41 | matrix: |
@@ -121,57 +91,3 @@ jobs: |
121 | 91 | with: |
122 | 92 | name: dist-${{ matrix.os }}-${{ matrix.cibw_arch }}-${{ matrix.cibw_python }} |
123 | 93 | path: wheelhouse/*.whl |
124 | | - |
125 | | - publish: |
126 | | - needs: [build-sdist, build-wheels] |
127 | | - runs-on: ubuntu-latest |
128 | | - |
129 | | - steps: |
130 | | - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 |
131 | | - with: |
132 | | - fetch-depth: 5 |
133 | | - submodules: false |
134 | | - |
135 | | - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
136 | | - with: |
137 | | - pattern: dist-* |
138 | | - merge-multiple: true |
139 | | - path: dist/ |
140 | | - |
141 | | - - name: Extract Release Version |
142 | | - id: relver |
143 | | - run: | |
144 | | - set -e |
145 | | - echo ::set-output name=version::$(cat dist/VERSION) |
146 | | - rm dist/VERSION |
147 | | -
|
148 | | - - name: Merge and tag the PR |
149 | | - uses: edgedb/action-release/merge@bae6b9134e872166b43d218dd79397c851c41c9a |
150 | | - with: |
151 | | - github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} |
152 | | - ssh_key: ${{ secrets.RELEASE_BOT_SSH_KEY }} |
153 | | - gpg_key: ${{ secrets.RELEASE_BOT_GPG_KEY }} |
154 | | - gpg_key_id: "5C468778062D87BF!" |
155 | | - tag_name: v${{ steps.relver.outputs.version }} |
156 | | - |
157 | | - - name: Publish Github Release |
158 | | - uses: elprans/gh-action-create-release@5f9abb8f0677196a76ea77e64341fa8ca31dad4f |
159 | | - env: |
160 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
161 | | - with: |
162 | | - tag_name: v${{ steps.relver.outputs.version }} |
163 | | - release_name: v${{ steps.relver.outputs.version }} |
164 | | - target: ${{ github.event.pull_request.base.ref }} |
165 | | - body: ${{ github.event.pull_request.body }} |
166 | | - draft: false |
167 | | - |
168 | | - - run: | |
169 | | - ls -al dist/ |
170 | | -
|
171 | | - - name: Upload to PyPI |
172 | | - uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3 |
173 | | - with: |
174 | | - user: __token__ |
175 | | - password: ${{ secrets.PYPI_TOKEN }} |
176 | | - # password: ${{ secrets.TEST_PYPI_TOKEN }} |
177 | | - # repository_url: https://test.pypi.org/legacy/ |
0 commit comments