forked from ssc-oscar/oscar.py
-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (118 loc) · 4.11 KB
/
release.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Build and publish to PyPI
on:
push:
tags:
- 'v*' # push tags to trigger the workflow
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
jobs:
build-wheel:
name: wheels
runs-on: ubuntu-latest
# trigger the workflow only on default branch, or manually
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp3{8,9,10,11}-manylinux_x86_64
# force manylinux2014 to avoid compatibility issues on RHEL 7
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# install required dependencies: bz2
CIBW_BEFORE_ALL: |
# Centos 7 is EOL and is no longer available from the usual mirrors, so switch
# to https://vault.centos.org
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf && \
sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/*.repo && \
sed -i 's;^#baseurl=http://mirror;baseurl=https://vault;g' /etc/yum.repos.d/*.repo
yum install -y bzip2-devel
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: wheelhouse/*.whl
build-sdist:
name: sdist
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Build source distribution
run: pipx run build --sdist
- name: Upload source distribution
uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*.tar.gz
publish:
name: publish
runs-on: ubuntu-latest
needs: [build-wheel, build-sdist]
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Download wheels
uses: actions/download-artifact@v2
with:
path: dist
- name: Move wheels to dist
run: |
mv dist/wheels/*.whl dist
mv dist/sdist/*.tar.gz dist
rm -r dist/wheels
rm -r dist/sdist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
release:
name: release
runs-on: ubuntu-latest
needs: [build-wheel, build-sdist]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download wheels
uses: actions/download-artifact@v2
with:
path: dist
- name: Move wheels to dist
run: |
mv dist/wheels/*.whl dist
mv dist/sdist/*.tar.gz dist
rm -r dist/wheels
rm -r dist/sdist
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Generate Changelog
run: |
npm install -g conventional-changelog-cli
conventional-changelog -p angular -i dist/CHANGELOG.md -s
- name: Create a new Release
uses: ncipollo/release-action@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# https://github.com/ncipollo/release-action for the full list of arguments
artifacts: dist/*.whl,dist/*.tar.gz
draft: true # generate a draft release
generateReleaseNotes: false
bodyFile: dist/CHANGELOG.md
# generate a pre-release if 'pre', 'rc', or 'beta' is in the tag name, or triggered manually
prerelease: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'beta') || contains(github.ref, 'rc') || contains(github.ref, 'pre') }}
# use the tag name if it's a tag, otherwise use the commit hash
continue-on-error: true