Skip to content

Commit

Permalink
fix(publish): Only run on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Bingner committed Nov 2, 2023
1 parent 41438ce commit 402d1e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ release-publish:
- mkdir -p ~/.ssh
- ssh-keyscan github.com >> ~/.ssh/known_hosts
script:
# Attempt to parse commit tag of format release/vX.X.X
- RELEASE_VERSION=${CI_COMMIT_TAG#release/v}
# Attempt to parse commit tag of format vX.X.X
- RELEASE_VERSION=${CI_COMMIT_TAG#v}
- |
if [[ -z "$RELEASE_VERSION" ]]; then
echo "Error: Failed to parse release version from tag ${CI_COMMIT_TAG}"
Expand All @@ -39,12 +39,12 @@ release-publish:
- LAST_TAG="$(git describe --tags --abbrev=0 HEAD~1)"
- jq ".version = \"${RELEASE_VERSION}\"" package.json > temp.json
- mv temp.json package.json
- git push [email protected]:corellium/corellium-api.git HEAD:master
- git push [email protected]:corellium/corellium-api.git "refs/tags/${CI_COMMIT_TAG}"
- jq . package.json
- npm publish
- git remote add github [email protected]:corellium/corellium-api.git
- git push github master
only:
- /release\/v*/
rules:
- if: '$CI_COMMIT_TAG =~ /^v/'

local-publish:
image:
Expand Down

0 comments on commit 402d1e7

Please sign in to comment.