Skip to content

release

release #918

Workflow file for this run

name: Build and Release
on:
repository_dispatch:
types: [ release ]
jobs:
build:
strategy:
matrix:
os: [ macos-latest, windows-latest ]
node-version: [ 16.x ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Branch
shell: bash -l {0}
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw##*/}
echo "BRANCH=$branch" >> $GITHUB_ENV
- run: echo ${{ env.BRANCH }}
- name: Creating Private Key
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Create Repository Dispatch
if: startsWith(matrix.os,'mac')
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GATING_PAT }}
repository: labsyspharm/gater
event-type: merge
client-payload: '{"ref": "${{ github.ref }}"}'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Node and Webpack
run: |
cd minerva_analysis
cd client
npm install
npm run start
rm -r node_modules/
cd ..
cd ..
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
environment-file: requirements.yml
activate-environment: minerva_analysis
- name: Package Windows
if: startsWith(matrix.os,'windows')
shell: cmd /C CALL {0}
run: |
package_win.bat
- name: Rename Windows
if: startsWith(matrix.os,'windows')
shell: bash -l {0}
run: |
ls dist/
mv dist/minerva_analysis_windows.exe "dist/minerva_analysis_windows_${{ env.BRANCH }}.exe"
ls dist/
- name: Package Mac
if: startsWith(matrix.os,'mac')
shell: bash -l {0}
run: |
./package_mac.sh
- name: Rename Mac
if: startsWith(matrix.os,'mac')
shell: bash -l {0}
run: |
mv dist/minerva_analysis_mac "dist/minerva_analysis_mac_${{ env.BRANCH }}"
cd dist
zip "minerva_analysis_mac_${{ env.BRANCH }}.zip" "minerva_analysis_mac_${{ env.BRANCH }}"
rm "minerva_analysis_mac_${{ env.BRANCH }}"
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}