@@ -3,9 +3,11 @@ name: 🏷️ Publish NPM Latest
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
+ dryrun :
7
+ type : boolean
8
+ description : Dry-Run
6
9
graduate :
7
10
type : boolean
8
- required : false
9
11
description : Force Conventional Graduate
10
12
11
13
permissions :
@@ -74,20 +76,31 @@ jobs:
74
76
demo/dist
75
77
retention-days : 5
76
78
77
- - name : Lerna Version (no graduate) 🏷️
78
- if : ${{ inputs.graduate == false }}
79
- env :
80
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
81
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
82
- NPM_CONFIG_PROVENANCE : true
79
+ - name : Lerna Version (build query)
80
+ shell : bash
83
81
run : |
84
- git config --global user.name "${{ github.actor }}"
85
- git config --global user.email "${{ github.actor }}@users.noreply.github.com"
86
- pnpm whoami
87
- pnpm exec lerna version --yes
88
-
89
- - name : Lerna Version (force graduate) 🏷️
90
- if : ${{ inputs.graduate == true }}
82
+ if ${{inputs.dryrun == true && inputs.graduate != true}}
83
+ then
84
+ echo "LERNA_VERSION_TYPE=🧪 Dry-Run" >> $GITHUB_ENV
85
+ echo "LERNA_VERSION_QUERY=pnpm exec lerna version --yes --dry-run" >> $GITHUB_ENV
86
+ elif ${{inputs.dryrun == true && inputs.graduate == true}}
87
+ then
88
+ echo "LERNA_VERSION_TYPE=🧪 Dry-Run w/Graduate" >> $GITHUB_ENV
89
+ echo "LERNA_VERSION_QUERY=pnpm exec lerna version --yes --dry-run --conventional-graduate" >> $GITHUB_ENV
90
+ elif ${{inputs.dryrun != true && inputs.graduate == true}}
91
+ then
92
+ echo "LERNA_VERSION_TYPE=🚀 Prod Version w/Graduate" >> $GITHUB_ENV
93
+ echo "LERNA_VERSION_QUERY=pnpm exec lerna version --yes --conventional-graduate" >> $GITHUB_ENV
94
+ elif ${{inputs.dryrun != true && inputs.graduate != true}}
95
+ then
96
+ echo "LERNA_VERSION_TYPE=🚀 Prod Version" >> $GITHUB_ENV
97
+ echo "LERNA_VERSION_QUERY=pnpm exec lerna version --yes" >> $GITHUB_ENV
98
+ fi
99
+
100
+ - name : Final version query type - ${{ env.LERNA_VERSION_TYPE }}
101
+ run : echo "${{ env.LERNA_VERSION_QUERY }}"
102
+
103
+ - name : Lerna Version 🏷️
91
104
env :
92
105
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
93
106
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
@@ -96,9 +109,10 @@ jobs:
96
109
git config --global user.name "${{ github.actor }}"
97
110
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
98
111
pnpm whoami
99
- pnpm exec lerna version --conventional-commits --conventional-graduate --yes
112
+ pnpm exec ${{ env.LERNA_VERSION_QUERY }}
100
113
101
114
- name : OTP
115
+ if : ${{ inputs.dryrun != true }}
102
116
uses : step-security/wait-for-secrets@v1
103
117
id : wait-for-secrets
104
118
with :
@@ -108,9 +122,20 @@ jobs:
108
122
description: 'OTP from authenticator app'
109
123
110
124
- name : Lerna Publish 📦
125
+ if : ${{ inputs.dryrun != true }}
111
126
env :
112
127
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
113
128
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
114
129
NPM_CONFIG_PROVENANCE : true
115
130
run : |
116
- pnpm exec lerna publish from-package --force-publish --yes --otp ${{ steps.wait-for-secrets.outputs.OTP }}
131
+ pnpm exec lerna publish from-package --force-publish --yes --otp ${{ steps.wait-for-secrets.outputs.OTP }}
132
+
133
+ - name : Build Website (GitHub demo site)
134
+ run : pnpm build:demo
135
+
136
+ - name : Deploy to gh-pages
137
+ if : github.ref == 'refs/heads/master'
138
+ uses : peaceiris/actions-gh-pages@v3
139
+ with :
140
+ github_token : ${{ secrets.GITHUB_TOKEN }}
141
+ publish_dir : ./demo/dist
0 commit comments