Skip to content

Fix release CI

Fix release CI #210

Workflow file for this run

name: release
on:
push:
branches:
- 'master'
- '*-release'
permissions:
contents: read
jobs:
check_tag:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get git tags (https://github.com/actions/checkout/issues/206)
run: git fetch --tags -f
- name: Get version from git tag
run: git describe --exact-match HEAD | grep '^v'
release:
runs-on: ubuntu-latest
needs: check_tag
if: ${{ github.repository_owner == 'visgl' && needs.check_tag.result == 'success' }}
env:
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get git tags (https://github.com/actions/checkout/issues/206)
run: git fetch --tags -f
- name: Use Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: '18.x'
- name: Create GitHub release entry
run: |
body=$(node scripts/github-release.js) &&
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/visgl/deck.gl/releases \
-d "${body}" \
-H "Authorization: token ${ADMIN_TOKEN}"
- name: Login to NPM
run: npm config set "//registry.npmjs.org/:_authToken=${NPM_ACCESS_TOKEN}"
- name: Install dependencies
run: yarn
- name: Publish to NPM
run: npx ocular-publish from-git