Skip to content

Commit ecec2fc

Browse files
committed
ci: clean up release task
This change is in preparation for the removal of the old bootstrap method in favour of the new `install-poetry` script. Releases no longer require platform specific build artifacts.
1 parent e175d2a commit ecec2fc

File tree

1 file changed

+27
-231
lines changed

1 file changed

+27
-231
lines changed

.github/workflows/release.yml

+27-231
Original file line numberDiff line numberDiff line change
@@ -6,250 +6,46 @@ on:
66
- '*.*.*'
77

88
jobs:
9-
10-
Linux:
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- uses: actions/checkout@v2
15-
- name: Get tag
16-
id: tag
17-
run: |
18-
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
19-
- name: Building release
20-
run: |
21-
make linux_release
22-
- name: Upload release file
23-
uses: actions/upload-artifact@v1
24-
with:
25-
name: poetry-${{ steps.tag.outputs.tag }}-linux.tar.gz
26-
path: releases/poetry-${{ steps.tag.outputs.tag }}-linux.tar.gz
27-
- name: Upload checksum file
28-
uses: actions/upload-artifact@v1
29-
with:
30-
name: poetry-${{ steps.tag.outputs.tag }}-linux.sha256sum
31-
path: releases/poetry-${{ steps.tag.outputs.tag }}-linux.sha256sum
32-
33-
MacOS:
34-
runs-on: macos-latest
35-
36-
steps:
37-
- uses: actions/checkout@v2
38-
- name: Get tag
39-
id: tag
40-
run: |
41-
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
42-
- name: Set up Python 3.8
43-
uses: actions/setup-python@v2
44-
with:
45-
python-version: "3.8"
46-
- name: Install Poetry
47-
run: |
48-
python get-poetry.py --preview -y
49-
source $HOME/.poetry/env
50-
- name: Install dependencies
51-
run: |
52-
source $HOME/.poetry/env
53-
poetry install --no-dev
54-
- name: Preparing Python executables
55-
run: |
56-
curl -L https://github.com/sdispater/python-binaries/releases/download/3.6.8/python-3.6.8.macos.tar.xz -o python-3.6.8.tar.xz
57-
curl -L https://github.com/sdispater/python-binaries/releases/download/3.7.6/python-3.7.6.macos.tar.xz -o python-3.7.6.tar.xz
58-
curl -L https://github.com/sdispater/python-binaries/releases/download/3.8.3/python-3.8.3.macos.tar.xz -o python-3.8.3.tar.xz
59-
curl -L https://github.com/sdispater/python-binaries/releases/download/3.9.0b4/python-3.9.0b4.macos.tar.xz -o python-3.9.0b4.tar.xz
60-
tar -zxf python-3.6.8.tar.xz
61-
tar -zxf python-3.7.6.tar.xz
62-
tar -zxf python-3.8.3.tar.xz
63-
tar -zxf python-3.9.0b4.tar.xz
64-
- name: Build specific release
65-
run: |
66-
source $HOME/.poetry/env
67-
poetry run python sonnet make release --ansi -P "3.6:python-3.6.8/bin/python" -P "3.7:python-3.7.6/bin/python" -P "3.8:python-3.8.3/bin/python" -P "3.9:python-3.9.0b4/bin/python"
68-
- name: Upload release file
69-
uses: actions/upload-artifact@v1
70-
with:
71-
name: poetry-${{ steps.tag.outputs.tag }}-darwin.tar.gz
72-
path: releases/poetry-${{ steps.tag.outputs.tag }}-darwin.tar.gz
73-
- name: Upload checksum file
74-
uses: actions/upload-artifact@v1
75-
with:
76-
name: poetry-${{ steps.tag.outputs.tag }}-darwin.sha256sum
77-
path: releases/poetry-${{ steps.tag.outputs.tag }}-darwin.sha256sum
78-
79-
Windows:
80-
runs-on: windows-latest
81-
82-
steps:
83-
- uses: actions/checkout@v2
84-
- name: Get tag
85-
id: tag
86-
shell: bash
87-
run: |
88-
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
89-
- name: Set up Python 3.8
90-
uses: actions/setup-python@v2
91-
with:
92-
python-version: "3.8"
93-
- name: Install Poetry
94-
run: |
95-
python get-poetry.py --preview -y
96-
$env:Path += ";$env:Userprofile\.poetry\bin"
97-
- name: Install dependencies
98-
run: |
99-
$env:Path += ";$env:Userprofile\.poetry\bin"
100-
poetry install --no-dev
101-
- name: Preparing Python executables
102-
run: |
103-
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.6.8/python-3.6.8.windows.tar.xz -O python-3.6.8.tar.xz
104-
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.7.6/python-3.7.6.windows.tar.xz -O python-3.7.6.tar.xz
105-
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.8.3/python-3.8.3.windows.tar.xz -O python-3.8.3.tar.xz
106-
Invoke-WebRequest https://github.com/sdispater/python-binaries/releases/download/3.9.0b4/python-3.9.0b4.windows.tar.xz -O python-3.9.0b4.tar.xz
107-
7z x python-3.6.8.tar.xz
108-
7z x python-3.7.6.tar.xz
109-
7z x python-3.8.3.tar.xz
110-
7z x python-3.9.0b4.tar.xz
111-
7z x python-3.6.8.tar
112-
7z x python-3.7.6.tar
113-
7z x python-3.8.3.tar
114-
7z x python-3.9.0b4.tar
115-
- name: Build specific release
116-
run: |
117-
$env:Path += ";$env:Userprofile\.poetry\bin"
118-
poetry run python sonnet make release --ansi -P "3.6:python-3.6.8\python.exe" -P "3.7:python-3.7.6\python.exe" -P "3.8:python-3.8.3\python.exe" -P "3.9:python-3.9.0b4\python.exe"
119-
- name: Upload release file
120-
uses: actions/upload-artifact@v1
121-
with:
122-
name: poetry-${{ steps.tag.outputs.tag }}-win32.tar.gz
123-
path: releases/poetry-${{ steps.tag.outputs.tag }}-win32.tar.gz
124-
- name: Upload checksum file
125-
uses: actions/upload-artifact@v1
126-
with:
127-
name: poetry-${{ steps.tag.outputs.tag }}-win32.sha256sum
128-
path: releases/poetry-${{ steps.tag.outputs.tag }}-win32.sha256sum
129-
1309
Release:
131-
needs: [Linux, MacOS, Windows]
13210
runs-on: ubuntu-latest
13311

13412
steps:
13513
- name: Checkout code
13614
uses: actions/checkout@v2
15+
13716
- name: Get tag
13817
id: tag
139-
run: |
140-
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
141-
- name: Download Linux release file
142-
uses: actions/download-artifact@master
143-
with:
144-
name: poetry-${{ steps.tag.outputs.tag }}-linux.tar.gz
145-
path: releases/
146-
- name: Download Linux checksum file
147-
uses: actions/download-artifact@master
148-
with:
149-
name: poetry-${{ steps.tag.outputs.tag }}-linux.sha256sum
150-
path: releases/
151-
- name: Download MacOS release file
152-
uses: actions/download-artifact@master
153-
with:
154-
name: poetry-${{ steps.tag.outputs.tag }}-darwin.tar.gz
155-
path: releases/
156-
- name: Download MacOS checksum file
157-
uses: actions/download-artifact@master
158-
with:
159-
name: poetry-${{ steps.tag.outputs.tag }}-darwin.sha256sum
160-
path: releases/
161-
- name: Download Windows release file
162-
uses: actions/download-artifact@master
163-
with:
164-
name: poetry-${{ steps.tag.outputs.tag }}-win32.tar.gz
165-
path: releases/
166-
- name: Download Windows checksum file
167-
uses: actions/download-artifact@master
168-
with:
169-
name: poetry-${{ steps.tag.outputs.tag }}-win32.sha256sum
170-
path: releases/
171-
- name: Create Release
172-
id: create_release
173-
uses: actions/create-release@v1
174-
env:
175-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176-
with:
177-
tag_name: ${{ steps.tag.outputs.tag }}
178-
release_name: ${{ steps.tag.outputs.tag }}
179-
draft: false
180-
prerelease: false
181-
- name: Upload Linux release file asset
182-
uses: actions/[email protected]
183-
env:
184-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185-
with:
186-
upload_url: ${{ steps.create_release.outputs.upload_url }}
187-
asset_path: releases/poetry-${{ steps.tag.outputs.tag }}-linux.tar.gz
188-
asset_name: poetry-${{ steps.tag.outputs.tag }}-linux.tar.gz
189-
asset_content_type: application/gzip
190-
- name: Upload Linux checksum file asset
191-
uses: actions/[email protected]
192-
env:
193-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
194-
with:
195-
upload_url: ${{ steps.create_release.outputs.upload_url }}
196-
asset_path: releases/poetry-${{ steps.tag.outputs.tag }}-linux.sha256sum
197-
asset_name: poetry-${{ steps.tag.outputs.tag }}-linux.sha256sum
198-
asset_content_type: text/plain
199-
- name: Upload MacOS release file asset
200-
uses: actions/[email protected]
201-
env:
202-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203-
with:
204-
upload_url: ${{ steps.create_release.outputs.upload_url }}
205-
asset_path: releases/poetry-${{ steps.tag.outputs.tag }}-darwin.tar.gz
206-
asset_name: poetry-${{ steps.tag.outputs.tag }}-darwin.tar.gz
207-
asset_content_type: application/gzip
208-
- name: Upload MacOS checksum file asset
209-
uses: actions/[email protected]
210-
env:
211-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
212-
with:
213-
upload_url: ${{ steps.create_release.outputs.upload_url }}
214-
asset_path: releases/poetry-${{ steps.tag.outputs.tag }}-darwin.sha256sum
215-
asset_name: poetry-${{ steps.tag.outputs.tag }}-darwin.sha256sum
216-
asset_content_type: text/plain
217-
- name: Upload Windows release file asset
218-
uses: actions/[email protected]
219-
env:
220-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
221-
with:
222-
upload_url: ${{ steps.create_release.outputs.upload_url }}
223-
asset_path: releases/poetry-${{ steps.tag.outputs.tag }}-win32.tar.gz
224-
asset_name: poetry-${{ steps.tag.outputs.tag }}-win32.tar.gz
225-
asset_content_type: application/gzip
226-
- name: Upload Windows checksum file asset
227-
uses: actions/[email protected]
228-
env:
229-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
230-
with:
231-
upload_url: ${{ steps.create_release.outputs.upload_url }}
232-
asset_path: releases/poetry-${{ steps.tag.outputs.tag }}-win32.sha256sum
233-
asset_name: poetry-${{ steps.tag.outputs.tag }}-win32.sha256sum
234-
asset_content_type: text/plain
235-
- name: Set up Python 3.8
18+
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
19+
20+
- name: Set up Python 3.9
23621
uses: actions/setup-python@v2
23722
with:
238-
python-version: "3.8"
23+
python-version: "3.9"
24+
23925
- name: Install Poetry
240-
run: |
241-
python get-poetry.py --preview -y
242-
- name: Install dependencies
243-
run: |
244-
source $HOME/.poetry/env
245-
poetry install --no-dev
26+
run: python install-poetry.py -y
27+
28+
- name: Update PATH
29+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
30+
24631
- name: Build project for distribution
32+
run: poetry run poetry build
33+
34+
- name: Check Version
35+
id: check-version
24736
run: |
248-
source $HOME/.poetry/env
249-
poetry run poetry build
37+
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
38+
|| echo ::set-output name=prerelease::true
39+
40+
- name: Create Release
41+
uses: ncipollo/release-action@v1
42+
with:
43+
artifacts: "dist/*"
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
draft: false
46+
prerelease: steps.check-version.outputs.prerelease == 'true'
47+
25048
- name: Publish to PyPI
25149
env:
25250
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
253-
run: |
254-
source $HOME/.poetry/env
255-
poetry run poetry publish
51+
run: poetry run poetry publish

0 commit comments

Comments
 (0)