-
Notifications
You must be signed in to change notification settings - Fork 24
152 lines (130 loc) · 4.94 KB
/
cd.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
# Continuous integration and delivery of the main branch.
name: CI/CD
on:
push:
branches:
- main
jobs:
# Run Python tests on Github runner
tox_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
steps:
- name: Checkout github repo (+ download lfs dependencies)
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
$CONDA/bin/conda install -y -c bioconda womtool
$CONDA/bin/conda config --add channels conda-forge
$CONDA/bin/conda install -y -c conda-forge miniwdl shellcheck
echo "$CONDA/bin" >> $GITHUB_PATH
- name: Test with tox
run: tox
# Send Slack message on workflow failure
- name: Slack Failure Notification
if: failure()
uses: rtCamp/[email protected]
env:
SLACK_COLOR: '#DF5A49'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnabad.png?raw=true
SLACK_USERNAME: long-read-pipelines
main_test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Runs a set of commands using the runners shell
- name: Continuous integration test suite
run: |
echo 'Test temporarily disabled.'
# Send Slack message on workflow failure
- name: Slack Failure Notification
if: failure()
uses: rtCamp/[email protected]
env:
SLACK_COLOR: '#DF5A49'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnabad.png?raw=true
SLACK_USERNAME: long-read-pipelines
# Send Slack message on workflow success
- name: Slack Success Notification
if: success()
uses: rtCamp/[email protected]
env:
SLACK_COLOR: '#50D9C9'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnagood.png?raw=true
SLACK_USERNAME: long-read-pipelines
deliver:
# Automatic delivery will run on a Github-hosted machine
needs: main_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Read Current Version
id: read_property
uses: christian-draeger/[email protected]
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/[email protected]
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: 'lrp_${{ steps.version-bump.outputs.new_ver }}'
body_path: "release_notes.txt"
draft: false
prerelease: false
- name: Slack Failure Notification
if: failure()
uses: rtCamp/[email protected]
env:
SLACK_MESSAGE: 'Failed to release version lrp_${{ steps.bump_version.outputs.next-version }}'
SLACK_COLOR: '#DF5A49'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnabad.png?raw=true
SLACK_USERNAME: long-read-pipelines
- name: Slack Success Notification
if: success()
uses: rtCamp/[email protected]
env:
SLACK_MESSAGE: 'Successfully released version lrp_${{ steps.bump_version.outputs.next-version }}'
SLACK_COLOR: '#50D9C9'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnagood.png?raw=true
SLACK_USERNAME: long-read-pipelines