-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (121 loc) · 4.16 KB
/
release-pathvisio.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
name: Build & Release PGKB PathVisio for Mac
on:
workflow_dispatch:
branches:
- '*'
push:
branches:
- "main"
paths-ignore:
- "**.md"
jobs:
build:
name: Build and Test
runs-on: macOS-latest
env:
PHARMGKB: /Users/runner/work/releasebot/releasebot/PharmGKB
PHARMGKB_USER: travis
CATALINA_HOME: /Users/runner/work/releasebot/releasebot/tomcat
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '^1.17.2'
- name: Config Go Cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-mod-
- name: Install github-release
run: go install github.com/github-release/github-release@latest
- name: Download Tomcat
run: |
tc_url=`curl -s https://tomcat.apache.org/download-90.cgi | grep -oE 'href="https?:.*apache-tomcat-9.[0-9]+.[0-9]+.tar.gz"' | grep -o 'http.*.gz' | head -n1`
echo "Downloading ${tc_url}"
wget -q $tc_url
tc_gz=`basename $tc_url`
tar -xf $tc_gz
tc_dir=`basename $tc_url ".tar.gz"`
ln -s $tc_dir tomcat
- name: Get PharmGKB version
run: echo PGKB_VERSION=`cat version.txt` >> $GITHUB_ENV
- name: Get PathVisio version
run: echo PATHVISIO_VERSION=`cat pathvisio_version.txt` >> $GITHUB_ENV
- run: echo PGKB=${{env.PGKB_VERSION}}, PATHVISIO=${{env.PATHVISIO_VERSION}}
- name: Checkout PharmGKB
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
repository: PharmGKB/PharmGKB
ref: ${{env.PGKB_VERSION}}
path: './PharmGKB'
- name: Checkout pgkb-common
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
repository: PharmGKB/pgkb-common
ref: 'main'
path: './PharmGKB/pgkb-common'
- name: Compile PathVisio
run: |
cd PharmGKB
cp passwords.properties.template passwords.properties
ant pathvisio-mac
- name: Upload PathVisio
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd PharmGKB
github-release upload --security-token ${{ secrets.GH_TOKEN }} \
--user PharmGKB \
--repo PharmGKB \
--tag ${{env.PGKB_VERSION}} \
--name "pgkb-pathvisio.zip" \
--file build/dist/pgkb-pathvisio.zip
- name: Upload PathVisio (mac)
run: |
cd PharmGKB
github-release upload --security-token ${{ secrets.GH_TOKEN }} \
--user PharmGKB \
--repo PharmGKB \
--tag ${{env.PGKB_VERSION}} \
--name "pgkb-pathvisio.app.full.zip" \
--file build/dist/pgkb-pathvisio.app.full.zip
- name: Create releasebot release
if: env.PGKB_VERSION == env.PATHVISIO_VERSION
run: |
github-release release --security-token ${{ secrets.GH_TOKEN }} \
--user PharmGKB \
--repo releasebot \
--tag ${{env.PGKB_VERSION}} \
--name ${{env.PGKB_VERSION}}
- name: Upload timestamp
if: env.PGKB_VERSION == env.PATHVISIO_VERSION
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
cd PharmGKB
github-release upload --security-token ${{ secrets.GH_TOKEN }} \
--user PharmGKB \
--repo releasebot \
--tag ${{env.PGKB_VERSION}} \
--name "pgkb-pathvisio.timestamp.txt" \
--file build/dist/pgkb-pathvisio.timestamp.txt
- name: Send Slack notification on failure
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: dev
status: FAILED
color: danger