chore(release): v0.1.2 #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
env: | |
HUSKY: 0 | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
skip: false | |
jobs: | |
release: | |
if: github.repository == 'yxw007/translate' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.7 | |
with: | |
ref: master | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
cache: pnpm | |
registry-url: https://registry.npmjs.org | |
- name: Install modules | |
run: pnpm install --no-frozen-lockfile | |
- name: Install tsx | |
run: pnpm install -g tsx | |
- name: Build | |
run: pnpm build | |
- name: Set npmrc | |
if: env.skip == 'false' | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | |
echo "registry=https://registry.npmjs.org" >> ~/.npmrc | |
echo "always-auth=true" >> ~/.npmrc | |
- uses: actions/setup-node@v4 | |
if: env.skip == 'false' | |
with: | |
node-version: '20.x' | |
# Note: Registration-url must be set here, otherwise the permissions will be wrong | |
registry-url: 'https://registry.npmjs.org' | |
- name: Publish package | |
if: env.skip == 'false' | |
run: pnpm publish --access public --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |