release v26.41.0 #160
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |