Fix release CI #208
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: 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' && jobs.check_tag.result == 'success' | ||
Check failure on line 31 in .github/workflows/release.yml GitHub Actions / releaseInvalid workflow file
|
||
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 |