feat: add new vercel template based on react-router #47
Workflow file for this run
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: Publish beta packages on NPM 📦 | |
on: | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
publish: | |
# prevents this action from running on forks | |
if: | | |
github.repository_owner == 'webstudio-is' && | |
startsWith(github.event.label.name, 'publish:') | |
timeout-minutes: 20 | |
runs-on: ubuntu-latest | |
env: | |
DATABASE_URL: postgres:// | |
AUTH_SECRET: test | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: pnpm | |
- name: Creating .npmrc | |
run: | | |
cat << EOF > "$HOME/.npmrc" | |
//registry.npmjs.org/:_authToken=$NPM_TOKEN | |
EOF | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# compute short sha | |
- id: short_sha | |
run: echo "value=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT | |
- id: tag | |
run: echo "value=$(echo ${{ github.event.label.name }} | cut -d ':' -f2)" >> $GITHUB_OUTPUT | |
- name: bump version to 0.0.0-${{ steps.short_sha.outputs.value }} | |
run: | | |
pnpx replace-in-files-cli \ | |
--string="0.0.0-webstudio-version" \ | |
--replacement="0.0.0-${{ steps.short_sha.outputs.value }}" \ | |
"**/package.json" | |
- run: pnpm install --ignore-scripts | |
- run: pnpm --filter="webstudio..." build | |
- run: pnpm --filter="webstudio..." dts | |
- name: Publishing ${{ steps.tag.outputs.value }} tag with sha ${{ steps.short_sha.outputs.value }} | |
run: pnpm -r publish --tag "${{ steps.tag.outputs.value }}" --no-git-checks --access public |