File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,16 +48,21 @@ jobs:
4848 run : |
4949 VERSION=$(node -p "require('./package.json').version")
5050 TAG="v$VERSION"
51- if git ls-remote --tags origin | grep -q "refs/tags/$TAG$" ; then
51+ if git ls-remote --exit-code -- tags origin "refs/tags/$TAG" >/dev/null 2>&1 ; then
5252 echo "Tag $TAG already exists on remote"
5353 echo "tag=$TAG" >> $GITHUB_OUTPUT
5454 else
5555 git config user.name "github-actions[bot]"
5656 git config user.email "github-actions[bot]@users.noreply.github.com"
5757 git tag -f "$TAG"
58- git push origin "$TAG"
58+ if git push origin "$TAG"; then
59+ echo "Pushed tag $TAG"
60+ elif git ls-remote --exit-code --tags origin "refs/tags/$TAG" >/dev/null 2>&1; then
61+ echo "Tag $TAG was created by another process"
62+ else
63+ exit 1
64+ fi
5965 echo "tag=$TAG" >> $GITHUB_OUTPUT
60- echo "Pushed tag $TAG"
6166 fi
6267
6368 build :
@@ -150,6 +155,8 @@ jobs:
150155 with :
151156 targets : ${{ matrix.target }}
152157
158+ - uses : arduino/setup-protoc@v3
159+
153160 - uses : Swatinem/rust-cache@v2
154161 with :
155162 workspaces : src-tauri
You can’t perform that action at this time.
0 commit comments