-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (189 loc) · 6.46 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# Continuous integration and delivery of the main branch.
name: CI/CD
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:
jobs:
release:
# Automatic release will run on a Github-hosted machine
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Read Current Version
id: read_property
uses: christian-draeger/read-properties@1.0.0
with:
path: 'VERSION'
property: 'version'
- name: Current Version
run: echo ${{ steps.read_property.outputs.value }}
- name: Generate Release Notes
# Retrieves the commit message from the last commit in current branch (main)
# and writes it to a file called release_notes.txt
run: git log --format=%B -n 1 ${{ github.event.after }} > release_notes.txt
- name: Github Bumpversion Action
id: version-bump
uses: jasonamyers/github-bumpversion-action@v1.0.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: "patch"
- name: New Version
run: echo ${{ steps.version-bump.outputs.new_ver }}
- name: Push Changes To Master/Main
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true
- name: Create Github release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version-bump.outputs.new_ver }}
release_name: 'glama_${{ steps.version-bump.outputs.new_ver }}'
body_path: "release_notes.txt"
draft: false
prerelease: false
- name: Slack Failure Notification
if: failure()
uses: rtCamp/action-slack-notify@v2.0.2
env:
SLACK_MESSAGE: 'Failed to release version glama_${{ steps.version-bump.outputs.new_ver }}'
SLACK_COLOR: '#DF5A49'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://github.com/broadinstitute/glama/blob/main/.github/workflows/dnabad.png?raw=true
SLACK_USERNAME: glama
- name: Slack Success Notification
if: success()
uses: rtCamp/action-slack-notify@v2.0.2
env:
SLACK_MESSAGE: 'Successfully released version glama_${{ steps.version-bump.outputs.new_ver }}'
SLACK_COLOR: '#50D9C9'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://github.com/broadinstitute/glama/blob/main/.github/workflows/dnagood.png?raw=true
SLACK_USERNAME: glama
linux:
needs: [release]
runs-on: ubuntu-latest
strategy:
matrix:
#target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
target: [x86_64]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Checkout specific tag
uses: actions/checkout@v2
with:
ref: ${{ steps.previoustag.outputs.tag }}
# - uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: -m crates/glama/Cargo.toml --release --out dist
sccache: 'true'
manylinux: auto
before-script-linux: |
# If we're running on rhel centos, install needed packages.
if command -v yum &> /dev/null; then
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
# If we're running on i686 we need to symlink libatomic
# in order to build openssl with -latomic flag.
if [[ ! -d "/usr/lib64" ]]; then
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
fi
else
# If we're running on debian-based system.
apt update -y && apt-get install -y libssl-dev openssl pkg-config
fi
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
macos:
needs: [release]
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Checkout specific tag
uses: actions/checkout@v2
with:
ref: ${{ steps.previoustag.outputs.tag }}
# - uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: -m crates/glama/Cargo.toml --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
sdist:
needs: [release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Checkout specific tag
uses: actions/checkout@v2
with:
ref: ${{ steps.previoustag.outputs.tag }}
# - uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: -m crates/glama/Cargo.toml --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
publish:
runs-on: ubuntu-latest
needs: [release, linux, macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing *