Fix tooltips in segmentations without locations in spatial layer (#1982) #147
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
# Adapted from https://github.com/actions/starter-workflows/blob/e9e00b017736d3b3811cedf1ee2e8ceb3c48e3dd/ci/npm-publish.yml | |
name: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
name: Deploy | |
permissions: | |
# Need "write" to interact with GitHub's OIDC Token endpoint. | |
id-token: write | |
# Need "read" to interact with GitHub's OIDC Token endpoint. Need "write" to create release. Write also includes Read. | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Reference: https://github.com/changesets/changesets/issues/517#issuecomment-1182094769 | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20.10.0 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
run_install: true | |
- id: get-options | |
run: . ./scripts/set-node-options.sh --action | |
shell: bash | |
- run: pnpm run build:ci && pnpm run bundle:ci && pnpm run build-json-schema | |
env: | |
NODE_OPTIONS: ${{ steps.get-options.outputs.node-options }} | |
- run: ./scripts/test.sh --action | |
- name: Create release pull request or Publish to NPM | |
if: github.repository == 'vitessce/vitessce' | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
title: Create release | |
# this expects you to have a npm script called changeset-version that runs some logic and then calls `changeset version`. | |
version: ./scripts/changeset-version.sh --action | |
# This expects you to have a script called changeset-publish which does a build for the packages and calls `changeset publish` | |
publish: ./scripts/changeset-publish.sh --action | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- id: get-tag | |
run: echo "tag=v$(cat ./package.json | jq -r .version)" >> $GITHUB_OUTPUT | |
- name: Append versioned URLs to RELEASE_NOTES.md | |
if: steps.changesets.outputs.should-release == 'true' | |
run: | | |
export DATE=`date "+%Y-%m-%d"` | |
export HASH=`git rev-parse --short HEAD` | |
export VERSIONED_DOCS_URL="https://legacy.vitessce.io/docs/$DATE/$HASH/" | |
export VERSIONED_DEMO_URL="https://legacy.vitessce.io/demos/$DATE/$HASH/" | |
echo "### Versioned Sites" >> RELEASE_NOTES.md | |
echo "- [Docs]($VERSIONED_DOCS_URL)" >> RELEASE_NOTES.md | |
echo "- [Demo]($VERSIONED_DEMO_URL)" >> RELEASE_NOTES.md | |
- name: Create GitHub release if publish was successful | |
if: steps.changesets.outputs.should-release == 'true' | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ steps.get-tag.outputs.tag }} | |
body_path: RELEASE_NOTES.md | |
- name: Build demo site and docs site (twice) | |
if: steps.changesets.outputs.should-release == 'true' | |
run: ./scripts/build-sites.sh --action | |
- name: Configure AWS credentials | |
if: steps.changesets.outputs.should-release == 'true' | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_IAM_ROLE }} | |
aws-region: us-east-1 | |
- name: Push sites to S3 | |
if: steps.changesets.outputs.should-release == 'true' | |
run: | | |
export DATE=`date "+%Y-%m-%d"` | |
export HASH=`git rev-parse --short HEAD` | |
aws s3 cp --recursive sites/docs/dist-versioned s3://legacy.vitessce.io/docs/$DATE/$HASH/ | |
aws s3 cp --recursive sites/docs/dist-root s3://legacy.vitessce.io/docs-root/$DATE/$HASH/ | |
aws s3 cp --recursive sites/demo/dist s3://legacy.vitessce.io/demos/$DATE/$HASH/ | |
aws s3 rm --recursive s3://vitessce-docs/ | |
aws s3 cp --recursive sites/docs/dist-root s3://vitessce-docs/ | |
aws s3 rm --recursive s3://vitessce-dev/ | |
aws s3 cp --recursive sites/demo/dist s3://vitessce-dev/ | |
- name: Invalidate CloudFront caches | |
if: steps.changesets.outputs.should-release == 'true' | |
run: | | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DOCS_CF_DISTRIBUTION_ID }} --paths "/*" | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DEMO_CF_DISTRIBUTION_ID }} --paths "/*" | |