|
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 | - "uvloop/_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: uvloop/_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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
41 | | - with: |
42 | | - name: dist-version |
43 | | - path: dist/ |
44 | | - |
45 | | - build-sdist: |
46 | | - needs: validate-release-request |
47 | | - runs-on: ubuntu-22.04 |
48 | | - |
49 | | - env: |
50 | | - PIP_DISABLE_PIP_VERSION_CHECK: 1 |
51 | | - |
52 | | - steps: |
53 | | - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
54 | | - with: |
55 | | - fetch-depth: 50 |
56 | | - submodules: true |
57 | | - |
58 | | - - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 |
59 | | - with: |
60 | | - python-version: 3.x |
61 | | - |
62 | | - - name: Build source distribution |
63 | | - run: | |
64 | | - python -m pip install --upgrade setuptools wheel pip |
65 | | - python setup.py sdist |
66 | | -
|
67 | | - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
68 | | - with: |
69 | | - name: dist-sdist |
70 | | - path: dist/*.tar.* |
71 | | - |
72 | 17 | build-wheels: |
73 | | - needs: validate-release-request |
74 | 18 | runs-on: ${{ matrix.os }} |
75 | 19 | strategy: |
76 | 20 | fail-fast: false |
@@ -127,57 +71,3 @@ jobs: |
127 | 71 | with: |
128 | 72 | name: dist-wheels-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.cibw_arch }} |
129 | 73 | path: wheelhouse/*.whl |
130 | | - |
131 | | - publish: |
132 | | - needs: [build-sdist, build-wheels] |
133 | | - runs-on: ubuntu-latest |
134 | | - |
135 | | - steps: |
136 | | - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 |
137 | | - with: |
138 | | - fetch-depth: 5 |
139 | | - submodules: false |
140 | | - |
141 | | - - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 |
142 | | - with: |
143 | | - pattern: dist-* |
144 | | - merge-multiple: true |
145 | | - path: dist/ |
146 | | - |
147 | | - - name: Extract Release Version |
148 | | - id: relver |
149 | | - run: | |
150 | | - set -e |
151 | | - echo version=$(cat dist/VERSION) >> $GITHUB_OUTPUT |
152 | | - rm dist/VERSION |
153 | | -
|
154 | | - - name: Merge and tag the PR |
155 | | - uses: edgedb/action-release/merge@bae6b9134e872166b43d218dd79397c851c41c9a |
156 | | - with: |
157 | | - github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }} |
158 | | - ssh_key: ${{ secrets.RELEASE_BOT_SSH_KEY }} |
159 | | - gpg_key: ${{ secrets.RELEASE_BOT_GPG_KEY }} |
160 | | - gpg_key_id: "5C468778062D87BF!" |
161 | | - tag_name: v${{ steps.relver.outputs.version }} |
162 | | - |
163 | | - - name: Publish Github Release |
164 | | - uses: elprans/gh-action-create-release@master |
165 | | - env: |
166 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
167 | | - with: |
168 | | - tag_name: v${{ steps.relver.outputs.version }} |
169 | | - release_name: v${{ steps.relver.outputs.version }} |
170 | | - target: ${{ github.event.pull_request.base.ref }} |
171 | | - body: ${{ github.event.pull_request.body }} |
172 | | - draft: false |
173 | | - |
174 | | - - run: | |
175 | | - ls -al dist/ |
176 | | -
|
177 | | - - name: Upload to PyPI |
178 | | - uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10 |
179 | | - with: |
180 | | - user: __token__ |
181 | | - password: ${{ secrets.PYPI_TOKEN }} |
182 | | - # password: ${{ secrets.TEST_PYPI_TOKEN }} |
183 | | - # repository_url: https://test.pypi.org/legacy/ |
0 commit comments