Skip to content

Commit db1af43

Browse files
authored
Merge pull request #10 from cloudflare/ci-workflow
devops: ci workflow
2 parents 96c9aa2 + 0d4bb37 commit db1af43

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/cf_ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Playwright MCP for Cloudflare - CI"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '20.x'
17+
registry-url: 'https://registry.npmjs.org'
18+
19+
- run: |
20+
npm ci
21+
cd cloudflare
22+
npm run build
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Playwright MCP for Cloudflare - Publish NPM"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
cf-release:
9+
name: "Publish Playwright MCP for Cloudflare to NPM"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: "20.x"
16+
registry-url: "https://registry.npmjs.org"
17+
18+
- name: Run npm ci
19+
run: npm ci
20+
21+
- name: Run playwright-mcp-cloudflare build
22+
run: |
23+
cd cloudflare
24+
npm run build
25+
26+
- name: Determine version
27+
id: version
28+
run: |
29+
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
30+
echo "Triggered by tag: ${GITHUB_REF#refs/tags/}"
31+
VERSION="${GITHUB_REF#refs/tags/}"
32+
else
33+
echo "❌ Unexpected trigger: ${GITHUB_REF}"
34+
exit 1
35+
fi
36+
# Set the output for later steps
37+
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
38+
39+
- name: Publish to npm
40+
run: |
41+
cd cloudflare
42+
cp ../README.md .
43+
npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version
44+
npm publish
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

0 commit comments

Comments
 (0)