-
Notifications
You must be signed in to change notification settings - Fork 55
92 lines (78 loc) · 2.36 KB
/
release.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Create and publish package
on:
push:
tags:
- '*'
jobs:
pre-build-checks:
name: Pre-build checks
uses: ./.github/workflows/tests.yaml
build:
name: Build package
runs-on: ubuntu-latest
needs: pre-build-checks
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade build
- name: Build packages
run: python -m build
- name: Save artifacts
uses: actions/upload-artifact@v3
with:
name: packages-${{ github.ref_name }}
path: dist/*
pypi-release:
name: Upload packages to PyPi
needs: build
runs-on: ubuntu-latest
if: ${{ !contains(github.ref_name, 'dev')}} # Ignore dev releases
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade twine
- name: Download artifacts
uses: actions/[email protected]
with:
name: packages-${{ github.ref_name }}
path: dist/
- name: Upload packages
run: python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
github-release:
name: Create release on Github
needs: build
runs-on: ubuntu-latest
steps:
- name: Get packages
uses: actions/[email protected]
with:
name: packages-${{ github.ref_name }}
path: dist/
- name: Create new release
continue-on-error: true # If this fails, we can do it by hand
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }} # Provided by github actions, no need to configure
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: |
Summary:
- TODO
Install it: https://pypi.org/project/mollie-api-python/${{ github.ref_name }}
draft: true
artifacts: dist/*