@@ -151,43 +151,42 @@ jobs:
151151 needs :
152152 - test
153153 - attw
154- strategy :
155- runs-on : ubuntu-22.04
156- permissions :
157- contents : read
158- id-token : write
159- steps :
154+ runs-on : ubuntu-22.04
155+ permissions :
156+ contents : read
157+ id-token : write
158+ steps :
160159 - uses : actions/checkout@v4
161-
160+
162161 - uses : actions/setup-node@v4
163162 with :
164163 node-version : ' 22'
165164 registry-url : ' https://registry.npmjs.org'
166-
165+
167166 - uses : pnpm/action-setup@v3
168167 name : Install pnpm
169168 id : pnpm-install
170169 with :
171170 version : latest
172171 run_install : false
173-
172+
174173 - name : Get pnpm store directory
175174 id : pnpm-cache
176175 shell : bash
177176 run : |
178177 echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
179-
178+
180179 - uses : actions/cache@v4
181180 name : Setup pnpm cache
182181 with :
183182 path : ${{ steps.pnpm-cache.outputs.STORE_PATH }}
184183 key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
185184 restore-keys : |
186185 ${{ runner.os }}-pnpm-store-
187-
186+
188187 - name : Install dependencies
189188 run : pnpm install
190-
189+
191190 - name : Check preconditions
192191 id : checks
193192 shell : bash
@@ -198,7 +197,7 @@ jobs:
198197 npm version $version
199198 tag="${{ github.ref_name }}"
200199 is_version_published="$(npm view waddler versions --json | jq -r '.[] | select(. == "'$version'") | . == "'$version'"')"
201-
200+
202201 if [[ "$is_version_published" == "true" ]]; then
203202 echo "\`waddler$version\` already published, adding tag \`$tag\`" >> $GITHUB_STEP_SUMMARY
204203 npm dist-tag add waddler@$version $tag
@@ -209,30 +208,30 @@ jobs:
209208 echo "has_new_release=true"
210209 } >> $GITHUB_OUTPUT
211210 fi
212-
211+
213212 - name : Build
214213 if : steps.checks.outputs.has_new_release == 'true'
215214 run : pnpm build
216-
215+
217216 - name : Pack
218217 if : steps.checks.outputs.has_new_release == 'true'
219218 working-directory : waddler
220219 shell : bash
221220 env :
222221 NODE_AUTH_TOKEN : ${{ secrets.NPM_ACCESS_TOKEN }}
223222 run : npm run pack
224-
223+
225224 - name : Publish
226225 if : github.event_name == 'push' && steps.checks.outputs.has_new_release == 'true'
227226 run : |
228227 tag="${{ steps.checks.outputs.tag }}"
229228 version="${{ steps.checks.outputs.version }}"
230-
229+
231230 echo "Publishing waddler@$tag using version $version"
232231 npm run publish -- --tag $tag
233-
232+
234233 echo "npm: \`waddler@$tag | waddler@$version\`" >> $GITHUB_STEP_SUMMARY
235-
234+
236235 # Post release message to Discord
237236 # curl -X POST -H "Content-Type: application/json" -d "{\"embeds\": [{\"title\": \"New \`waddler\` release! 🎉\", \"url\": \"https://www.npmjs.com/package/waddler/v/$version\", \"color\": \"12907856\", \"fields\": [{\"name\": \"Version\", \"value\": \"\`$version\`\"}, {\"name\": \"Tag\", \"value\": \"\`$tag\`\"}]}]}" ${{ secrets.DISCORD_DEV_RELEASE_WEBHOOK_URL }}
238237 working-directory : waddler
0 commit comments