Skip to content

Merge pull request #1470 from FZJ-INM1-BDA/staging #84

Merge pull request #1470 from FZJ-INM1-BDA/staging

Merge pull request #1470 from FZJ-INM1-BDA/staging #84

Workflow file for this run

name: Release
on:
push:
branches:
- master
jobs:
check-version:
outputs:
package-version: ${{ steps.set-version.outputs.package-version-from-json }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set version
id: set-version
run: |
PACKAGEJSON_VER=v$(cat package.json | jq -r '.version')
echo "package-version-from-json=$PACKAGEJSON_VER" >> $GITHUB_OUTPUT
create-release:
needs: check-version
if: success()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.check-version.outputs.package-version }}
release_name: Release ${{ needs.check-version.outputs.package-version }}
body_path: docs/releases/${{ needs.check-version.outputs.package-version }}.md
draft: false
prerelease: false
- name: Use Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Build & zip assets
run: |
STRICT_LOCAL=true node ./src/environments/parseEnv.js
npm i && npm run build
zip -r siibra-explorer-${{ needs.check-version.outputs.package-version }}.zip ./dist
- name: Attach built as release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./siibra-explorer-${{ needs.check-version.outputs.package-version }}.zip
asset_name: siibra-explorer-${{ needs.check-version.outputs.package-version }}.zip
asset_content_type: application/zip