Skip to content

fix: isolate remotion typecheck in ci #88

fix: isolate remotion typecheck in ci

fix: isolate remotion typecheck in ci #88

Workflow file for this run

name: Production Release
on:
workflow_dispatch:
push:
branches: [main]
permissions:
contents: write
jobs:
check-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.11'
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Read release metadata
id: release
shell: bash
run: |
VERSION=$(node -p "require('./package.json').version")
PACKAGE_NAME=$(node -p "require('./package.json').name")
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
echo "package=$PACKAGE_NAME" >> "$GITHUB_OUTPUT"
- name: Check npm publication status
id: npm
shell: bash
run: |
if npm view "${{ steps.release.outputs.package }}@${{ steps.release.outputs.version }}" version >/dev/null 2>&1; then
echo "publish=false" >> "$GITHUB_OUTPUT"
else
echo "publish=true" >> "$GITHUB_OUTPUT"
fi
- name: Verify release candidate
if: steps.npm.outputs.publish == 'true'
run: bun run verify
- name: Calculate artifact fingerprints
if: steps.npm.outputs.publish == 'true'
run: bun run scripts/fingerprint.ts
- name: Create immutable release tag
if: steps.npm.outputs.publish == 'true'
shell: bash
run: |
TAG="${{ steps.release.outputs.tag }}"
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
if git rev-parse "refs/tags/$TAG" >/dev/null 2>&1; then
test "$(git rev-list -n 1 "$TAG")" = "$GITHUB_SHA"
else
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"
fi
- name: Publish to npm
if: steps.npm.outputs.publish == 'true'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
shell: bash
run: |
trap 'rm -f .npmrc' EXIT
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
npm publish --access public
- name: Create GitHub release
if: steps.npm.outputs.publish == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release.outputs.tag }}
files: |
dist/index.js
dist/bvm-shim.sh
dist/bvm-shim.js
install.sh
install.ps1
generate_release_notes: true
- name: Trigger mirror sync
if: steps.npm.outputs.publish == 'true'
run: curl --fail-with-body -X PUT "https://registry-direct.npmmirror.com/${{ steps.release.outputs.package }}/sync?nodeps=true&publish=true"
- name: Purge jsDelivr cache
if: steps.npm.outputs.publish == 'true'
run: |
curl --fail-with-body "https://purge.jsdelivr.net/gh/${{ github.repository }}@${{ steps.release.outputs.tag }}/dist/index.js"
curl --fail-with-body "https://purge.jsdelivr.net/gh/${{ github.repository }}@latest/dist/index.js"