-
Notifications
You must be signed in to change notification settings - Fork 36
52 lines (43 loc) · 1.39 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Publish to npmjs
on:
workflow_dispatch:
inputs:
version:
description: 'リリースしたいバージョン名'
required: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.node-version'
cache: yarn
registry-url: 'https://registry.npmjs.org'
- name: Install node dependencies
run: yarn install --immutable
- name: Set git username and email
run: |
git config --local user.email "[email protected]"
git config --local user.name "actions-user"
- name: Set package version
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: yarn lerna version ${{ github.event.inputs.version }} --no-push --force-publish --yes
- name: git push version up commits
run: |
git push origin ${{ github.ref_name }}
- name: Build & Publish to npmjs
run: yarn release -y from-package
env:
NPM_CONFIG_PROVENANCE: true
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}