【发布时间】:2021-09-02 01:33:05
【问题描述】:
我正在将我们现有的 Travis 任务迁移到 GH 操作。对于 Travis,以下命令将发布到 npm 并使用 npm 版本的发布标签名称。
script: yarn npm-bundle && npm version $TRAVIS_BRANCH --allow-same-version -m
"chore - release version %s [skip ci]" --allow-empty
不幸的是,更改为以下不起作用...
run: |
yarn npm-bundle && npm version ${{ github.event.release.tag_name }} --allow-same-version -m "chore - release version %s [skip ci]" --allow-empty
npm publish --access public --dry-run
它显然是空的,因为 npm 使用的是 package.json 中的版本。我尝试了一些其他变量,例如${{ github.head_ref }}
还有……
run: |
yarn npm-bundle -m "chore - release version %s [skip ci]" --allow-empty
npm publish --tag ${{ github.event.release.tag_name }} --allow-same-version --access public --dry-run
【问题讨论】:
标签: npm github-actions npm-publish npm-version