Skip to content

Commit

Permalink
ci: add notice for external builds
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Oct 29, 2024
1 parent 3def849 commit a6d2c1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 216 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/npm-publish-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,19 @@ name: npm publish from PR
on:
workflow_dispatch:
inputs:
# source:
# description: 'source ref: `google/zx/main/0cba...f9`'
repo:
description: 'source gh repo, like `google/zx`'
# branch:
# description: 'target branch'
commit:
description: 'commit id'
# cmd:
# description: 'build cmd'
# default: 'npm ci && npm run build'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Use Node.js 23
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 23
node-version: 22

- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -67,5 +60,8 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: |
node -e "const fs = require('fs'); fs.writeFileSync('./README.md', process.env.NOTICE + fs.readFileSync('./README.md'))"
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-pr.${{ github.run_id }} --no-git-tag-version
npm publish --provenance --access=public --no-git-tag-version --tag pr
env:
NOTICE: "> ⚠<fe0f> **This snapshot was built from the external source** \n> repo: ${{ github.event.inputs.repo }} \n> commit: ${{ github.event.inputs.commit }}\n"
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"test:unit": "c8 -r lcov -r text -o target/coverage -x src/scripts -x src/test -x target node --loader ts-node/esm --experimental-specifier-resolution=node src/scripts/test.mjs",
"test:smoke:esm": "node ./src/test/smoke/invoke.test.mjs",
"test:smoke:cjs": "node src/test/smoke/invoke.test.cjs",
"publish:draft": "npm run build && npm publish --no-git-tag-version",
"manual:test:build-from-remote": "NODE_OPTIONS='--experimental-strip-types' npx zx@latest ./src/scripts/build-from-remote.mts --mode=test"
"publish:draft": "npm run build && npm publish --no-git-tag-version"
},
"repository": {
"type": "git",
Expand Down
205 changes: 0 additions & 205 deletions src/scripts/build-from-remote.mts

This file was deleted.

0 comments on commit a6d2c1a

Please sign in to comment.