File tree 1 file changed +27
-8
lines changed
1 file changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -23,19 +23,38 @@ jobs:
23
23
- run : npm install -g npm
24
24
- run : npm install
25
25
- run : npm test
26
- - run : npm publish --provenance --access public --tag alpha
26
+ - name : npm publish
27
+ run : |
28
+ version=$(jq -r .version package.json)
29
+ tag_meta=$(echo "$version" | cut -s -d '-' -f2)
30
+ if [[ -z "$tag_meta" ]]; then
31
+ npm publish --provenance --access public
32
+ else
33
+ tag=$(echo "$tag_meta" | cut -d '.' -f1)
34
+ npm publish --provenance --access public --tag "$tag"
35
+ fi
27
36
env :
28
37
NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
29
38
- name : Publish version on GitHub
30
39
run : |
31
40
version=$(jq -r .version package.json)
32
- gh release create \
33
- -n "This is a 9.0.0 pre-release alpha. Changes may not be stable." \
34
- --latest=false \
35
- --prerelease \
36
- --target "$BRANCH_NAME" \
37
- --title "v$version" \
38
- "v$version"
41
+ tag_meta=$(echo "$version" | cut -s -d '-' -f2)
42
+ if [[ -z "$tag_meta" ]]; then
43
+ gh release create \
44
+ -n "[Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/$BRANCH_NAME/changelog-client.html)"
45
+ --target "$BRANCH_NAME" \
46
+ --title "v$version" \
47
+ "v$version"
48
+ else
49
+ tag_main=$(echo "$version" | cut -d '-' -f1)
50
+ gh release create \
51
+ -n "This is a $tag_main pre-release. Changes may not be stable." \
52
+ --latest=false \
53
+ --prerelease \
54
+ --target "$BRANCH_NAME" \
55
+ --title "v$version" \
56
+ "v$version"
57
+ fi
39
58
env :
40
59
BRANCH_NAME : ${{ github.event.inputs.branch }}
41
60
GH_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments