Skip to content

Commit c012b04

Browse files
authored
ci: dont create release and upload wheels at once (quickwit-oss#64)
1 parent 5c7432c commit c012b04

File tree

1 file changed

+42
-43
lines changed

1 file changed

+42
-43
lines changed

.github/workflows/publish.yaml

Lines changed: 42 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,15 @@
11
name: Test & Release
22

33
on:
4-
push:
5-
tags:
6-
- '*'
7-
# pull_request:
8-
# branches:
9-
# - master
4+
release:
5+
types: [published]
6+
# pull_request:
7+
# branches:
8+
# - master
109

1110
jobs:
12-
create-release:
13-
permissions:
14-
contents: write # for actions/create-release to create a release
15-
name: create-release
16-
runs-on: ubuntu-latest
17-
outputs:
18-
upload_url: ${{ steps.release.outputs.upload_url }}
19-
release_version: ${{ env.RELEASE_VERSION }}
20-
steps:
21-
- name: Harden Runner
22-
uses: step-security/harden-runner@c8454efe5d0bdefd25384362fe217428ca277d57 # v1
23-
with:
24-
disable-sudo: true
25-
egress-policy: block
26-
allowed-endpoints: >
27-
api.github.com:443
28-
29-
- name: Get the release version from the tag
30-
shell: bash
31-
if: env.RELEASE_VERSION == ''
32-
run: |
33-
# See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
34-
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
35-
echo "version is: ${{ env.RELEASE_VERSION }}"
36-
37-
- name: Create GitHub release
38-
id: release
39-
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
40-
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
with:
43-
tag_name: ${{ env.RELEASE_VERSION }}
44-
release_name: ${{ env.RELEASE_VERSION }}
45-
4611
linux:
4712
runs-on: ubuntu-latest
48-
needs: create-release
4913
strategy:
5014
matrix:
5115
platform: [ 'x86_64-unknown-linux-gnu', 'aarch64-unknown-linux-gnu' ]
@@ -92,7 +56,6 @@ jobs:
9256

9357
windows:
9458
runs-on: windows-latest
95-
needs: create-release
9659
strategy:
9760
matrix:
9861
target: [x64]
@@ -123,7 +86,6 @@ jobs:
12386

12487
macos:
12588
runs-on: macos-latest
126-
needs: create-release
12789
strategy:
12890
matrix:
12991
python-version: ['3.8', '3.9', '3.10', '3.11']
@@ -161,6 +123,43 @@ jobs:
161123
name: wheels
162124
path: dist
163125

126+
python-release-github:
127+
runs-on: ubuntu-latest
128+
needs: [ macos, windows, linux ]
129+
permissions:
130+
contents: write # To add assets to a release.
131+
steps:
132+
- name: Harden Runner
133+
uses: step-security/harden-runner@18bf8ad2ca49c14cbb28b91346d626ccfb00c518 # v2.1.0
134+
with:
135+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
136+
137+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
138+
with:
139+
ref: ${{ github.head_ref }}
140+
141+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
142+
with:
143+
profile: minimal
144+
toolchain: stable
145+
146+
- name: Set up Python 3.8
147+
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
148+
with:
149+
python-version: 3.8
150+
151+
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
152+
with:
153+
name: wheels
154+
path: wheels
155+
156+
- name: Upload release binaries
157+
uses: alexellis/upload-assets@259de5111cb56966d046ced998941e93f91d2c93
158+
env:
159+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
160+
with:
161+
asset_paths: '["./wheels/tantivy-*"]'
162+
164163
# release-pypy:
165164
# name: Release
166165
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)