-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathaction.yml
More file actions
43 lines (38 loc) · 1.21 KB
/
Copy pathaction.yml
File metadata and controls
43 lines (38 loc) · 1.21 KB
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
name: "Publish NPM to a given registry"
description: "Publish NPM to a given registry"
inputs:
npm_package_path:
description: "NPM package path"
npm_registry:
description: "NPM registry"
npm_publish_token:
description: "Publish token"
outputs:
version:
description: "version"
value: ${{ steps.publish_npm.outputs.version }}
runs:
using: "composite"
steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.15.1
- name: Publish NPM
shell: bash
working-directory: ${{ inputs.npm_package_path }}
id: publish_npm
run: |
echo "//${{ inputs.npm_registry }}/:_authToken=${{ inputs.npm_publish_token }}" >> .npmrc
echo "@raycast:registry=https://${{ inputs.npm_registry }}" >> .npmrc
version=`jq -r .version package.json`
name=`jq -r .name package.json`
public_version=`npm show $name version`
echo "Candidate version: $version"
echo "Registry version: $public_version"
if [[ "$version" != "$public_version" ]]; then
npm publish --provenance
echo "version=$version" >> $GITHUB_OUTPUT
else
echo "Skipping API publishing"
fi