mirror of
https://github.com/google/blockly.git
synced 2026-04-29 00:20:11 +02:00
Merge branch 'main' into merger
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on: [pull_request]
|
||||
on:
|
||||
pull_request:
|
||||
workflow_call:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
# Workflow for running the keyboard navigation plugin's automated tests.
|
||||
|
||||
name: Keyboard Navigation Automated Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
webdriverio_tests:
|
||||
name: WebdriverIO tests
|
||||
timeout-minutes: 10
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- name: Checkout core Blockly
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
path: core-blockly
|
||||
|
||||
- name: Checkout keyboard navigation plugin
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
repository: 'google/blockly-keyboard-experimentation'
|
||||
ref: 'main'
|
||||
path: blockly-keyboard-experimentation
|
||||
|
||||
- name: Use Node.js 20.x
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 20.x
|
||||
|
||||
- name: NPM install
|
||||
run: |
|
||||
cd core-blockly
|
||||
npm install
|
||||
cd ..
|
||||
cd blockly-keyboard-experimentation
|
||||
npm install
|
||||
cd ..
|
||||
|
||||
- name: Link latest core main with plugin
|
||||
run: |
|
||||
cd core-blockly/packages/blockly
|
||||
npm run package
|
||||
cd dist
|
||||
npm link
|
||||
cd ../../../../blockly-keyboard-experimentation
|
||||
npm link blockly
|
||||
cd ..
|
||||
|
||||
- name: Run keyboard navigation plugin tests
|
||||
run: |
|
||||
cd blockly-keyboard-experimentation
|
||||
npm run test
|
||||
@@ -0,0 +1,137 @@
|
||||
name: Publish to npm
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry_run:
|
||||
description: 'Dry run - print the version that would be published, but do not commit or publish anything.'
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
skip_versioning:
|
||||
description: >
|
||||
Skip version bump - use the version already in the repo
|
||||
(e.g. retry after npm publish failed but the release commit is already pushed).
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
uses: ./.github/workflows/build.yml
|
||||
|
||||
version:
|
||||
needs: ci
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 24.x
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Install dependencies
|
||||
if: ${{ !inputs.skip_versioning }}
|
||||
run: npm ci
|
||||
|
||||
- name: Determine version bump
|
||||
id: bump
|
||||
if: ${{ !inputs.skip_versioning }}
|
||||
working-directory: packages/blockly
|
||||
run: |
|
||||
RELEASE_TYPE=$(npx conventional-recommended-bump --preset conventionalcommits -t blockly-)
|
||||
echo "release_type=$RELEASE_TYPE" >> "$GITHUB_OUTPUT"
|
||||
echo "Recommended bump: $RELEASE_TYPE"
|
||||
|
||||
- name: Apply version bump
|
||||
if: ${{ !inputs.skip_versioning }}
|
||||
working-directory: packages/blockly
|
||||
run: npm version ${{ steps.bump.outputs.release_type }} --no-git-tag-version
|
||||
|
||||
- name: Read package version
|
||||
id: version
|
||||
working-directory: packages/blockly
|
||||
run: |
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "Version: $VERSION"
|
||||
|
||||
- name: Upload versioned files
|
||||
if: ${{ !inputs.skip_versioning }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: versioned-files
|
||||
path: |
|
||||
packages/blockly/package.json
|
||||
package-lock.json
|
||||
|
||||
publish:
|
||||
needs: version
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ !inputs.dry_run }}
|
||||
environment: release
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ssh-key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
|
||||
|
||||
- name: Download versioned files
|
||||
if: ${{ !inputs.skip_versioning }}
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: versioned-files
|
||||
|
||||
- name: Commit and push version bump
|
||||
if: ${{ !inputs.skip_versioning }}
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add packages/blockly/package.json package-lock.json
|
||||
git commit -m "release: v${{ needs.version.outputs.version }}"
|
||||
git push
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 24.x
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build package
|
||||
working-directory: packages/blockly
|
||||
run: npm run package
|
||||
|
||||
- name: Publish to npm
|
||||
working-directory: packages/blockly/dist
|
||||
run: npm publish --verbose
|
||||
|
||||
- name: Create tarball
|
||||
working-directory: packages/blockly
|
||||
run: npm pack ./dist
|
||||
|
||||
- name: Create GitHub release
|
||||
working-directory: packages/blockly
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
TARBALL="blockly-${{ needs.version.outputs.version }}.tgz"
|
||||
gh release create "blockly-v${{ needs.version.outputs.version }}" "$TARBALL" \
|
||||
--repo "$GITHUB_REPOSITORY" \
|
||||
--title "blockly-v${{ needs.version.outputs.version }}" \
|
||||
--generate-notes
|
||||
@@ -0,0 +1,36 @@
|
||||
# Manual workflow to update GitHub Pages from a chosen source branch.
|
||||
# The gulp updateGithubPages task builds the repo and force-pushes to gh-pages.
|
||||
|
||||
name: Update GitHub Pages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
source_branch:
|
||||
description: 'Source branch to build and deploy to GitHub Pages'
|
||||
required: true
|
||||
type: string
|
||||
default: main
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update-gh-pages:
|
||||
timeout-minutes: 15
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.source_branch }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version: 24.x
|
||||
|
||||
- name: Update GitHub Pages
|
||||
working-directory: ./packages/blockly
|
||||
run: npm run updateGithubPages:staging
|
||||
Reference in New Issue
Block a user