forked from Authenticator-Extension/Authenticator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtag.sh
18 lines (16 loc) · 864 Bytes
/
tag.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
# This script is used by travis to auto tag our releases
# Configure git
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git remote set-url origin [email protected]:${GITHUB_REPOSITORY}.git
gpg --quiet --batch --yes --decrypt --passphrase="$DEPLOY_KEY_PASSWORD" \
--output $GITHUB_WORKSPACE/scripts/deploy-key $GITHUB_WORKSPACE/scripts/deploy-key.gpg
chmod 600 $GITHUB_WORKSPACE/scripts/deploy-key
eval `ssh-agent -s` &> /dev/null
ssh-add $GITHUB_WORKSPACE/scripts/deploy-key &> /dev/null
# Create and push tag
export GIT_TAG=v$(grep -m 1 "\"version\"" $GITHUB_WORKSPACE/manifests/manifest-chrome.json | sed -r 's/^ *//;s/.*: *"//;s/",?//')
git checkout ${GITHUB_REF##*/}
git tag $GIT_TAG -a -m "Automatic tag from run $GITHUB_RUN_ID"
git push origin $GIT_TAG