-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (61 loc) · 2.26 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Deploy
on:
release:
types: [created]
workflow_dispatch:
jobs:
# Current issues:
# - The release name recovered seems to be wrong sometimes
# - The structure of a release is wrong to automate releasing - consider Twine instead
retrieve_artifacts:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
steps:
- name: Display tag name
run: echo "Tag name is ${{ github.event.release.name }}"
- name: Is TEST RELEASE
if: ${{ startsWith('test-',github.event.release.name) }}
run: echo "Is test release ${{ startsWith('test-',github.event.release.name) }}"
- name: Checkout
uses: actions/checkout@v2
- name: Retrieve wheel artifacts for release
uses: dawidd6/action-download-artifact@v6
with:
name: ${{ github.event.release.name }}-wheels
repo: ${{ github.repository }}
workflow: build.yml
path: ./dist
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Retrieve SDIST artifacts for release
uses: dawidd6/action-download-artifact@v6
with:
name: ${{ github.event.release.name }}-sdist
repo: ${{ github.repository }}
workflow: build.yml
path: ./dist
github_token: ${{ secrets.GITHUB_TOKEN }}
# Test step for debugging
- name: Display structure of downloaded files
run: ls -laR
working-directory: ./dist
- name: Release code as new release on Pypi
if: ${{ startsWith(github.event.release.name, 'v') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
repository-url: https://upload.pypi.org/legacy/
verbose: true
packages-dir: ./dist
- name: "TEST: Release code as new release on Test Pypi"
if: ${{ startsWith('test-',github.event.release.name) }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TEST_PASSWORD }}
repository-url: https://test.pypi.org/legacy/
verbose: true
packages-dir: ./dist
# TODO: Slack announcement
# TODO: Update linear labels?