mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-10-29 16:17:39 +09:00
- Update engines.node in all package.json files - Update .nvmrc to 22 - Update GitHub Actions workflows to node-version: 22
62 lines
1.8 KiB
YAML
62 lines
1.8 KiB
YAML
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: 22
|
|
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
|