23
.github/workflows/npm-publish.yml
vendored
23
.github/workflows/npm-publish.yml
vendored
@ -23,19 +23,38 @@ jobs:
|
|||||||
- run: npm install -g npm
|
- run: npm install -g npm
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm test
|
- run: npm test
|
||||||
- run: npm publish --provenance --access public --tag alpha
|
- name: npm publish
|
||||||
|
run: |
|
||||||
|
version=$(jq -r .version package.json)
|
||||||
|
tag_meta=$(echo "$version" | cut -s -d '-' -f2)
|
||||||
|
if [[ -z "$tag_meta" ]]; then
|
||||||
|
npm publish --provenance --access public
|
||||||
|
else
|
||||||
|
tag=$(echo "$tag_meta" | cut -d '.' -f1)
|
||||||
|
npm publish --provenance --access public --tag "$tag"
|
||||||
|
fi
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
- name: Publish version on GitHub
|
- name: Publish version on GitHub
|
||||||
run: |
|
run: |
|
||||||
version=$(jq -r .version package.json)
|
version=$(jq -r .version package.json)
|
||||||
|
tag_meta=$(echo "$version" | cut -s -d '-' -f2)
|
||||||
|
if [[ -z "$tag_meta" ]]; then
|
||||||
gh release create \
|
gh release create \
|
||||||
-n "This is a 9.0.0 pre-release alpha. Changes may not be stable." \
|
-n "[Changelog](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/$BRANCH_NAME/changelog-client.html)"
|
||||||
|
--target "$BRANCH_NAME" \
|
||||||
|
--title "v$version" \
|
||||||
|
"v$version"
|
||||||
|
else
|
||||||
|
tag_main=$(echo "$version" | cut -d '-' -f1)
|
||||||
|
gh release create \
|
||||||
|
-n "This is a $tag_main pre-release. Changes may not be stable." \
|
||||||
--latest=false \
|
--latest=false \
|
||||||
--prerelease \
|
--prerelease \
|
||||||
--target "$BRANCH_NAME" \
|
--target "$BRANCH_NAME" \
|
||||||
--title "v$version" \
|
--title "v$version" \
|
||||||
"v$version"
|
"v$version"
|
||||||
|
fi
|
||||||
env:
|
env:
|
||||||
BRANCH_NAME: ${{ github.event.inputs.branch }}
|
BRANCH_NAME: ${{ github.event.inputs.branch }}
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
Reference in New Issue
Block a user