File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ concurrency:
15
15
group : ${{ github.workflow }}
16
16
cancel-in-progress : true
17
17
18
- env :
19
- TAG_REGEX : ' ^rust-v[0-9]+\.[0-9]+\.[0-9]+$'
20
-
21
18
jobs :
22
19
tag-check :
23
20
runs-on : ubuntu-latest
33
30
# 1. Must be a tag and match the regex
34
31
[[ "${GITHUB_REF_TYPE}" == "tag" ]] \
35
32
|| { echo "❌ Not a tag push"; exit 1; }
36
- [[ "${GITHUB_REF_NAME}" =~ ${TAG_REGEX} ]] \
37
- || { echo "❌ Tag '${GITHUB_REF_NAME}' != ${TAG_REGEX} "; exit 1; }
33
+ [[ "${GITHUB_REF_NAME}" =~ ^rust-v[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta)(\.[0-9]+)?)?$ ]] \
34
+ || { echo "❌ Tag '${GITHUB_REF_NAME}' doesn't match expected format "; exit 1; }
38
35
39
36
# 2. Extract versions
40
37
tag_ver="${GITHUB_REF_NAME#rust-v}"
Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
+ # By default, this script uses a version based on the current date and time.
6
+ # If you want to specify a version, pass it as the first argument. Example:
7
+ #
8
+ # ./scripts/create_github_release.sh 0.1.0-alpha.4
9
+ #
10
+ # The value will be used to update the `version` field in `Cargo.toml`.
11
+
5
12
# Change to the root of the Cargo workspace.
6
13
cd " $( dirname " ${BASH_SOURCE[0]} " ) /.."
7
14
15
22
CURRENT_BRANCH=$( git symbolic-ref --short -q HEAD)
16
23
17
24
# Create a new branch for the release and make a commit with the new version.
18
- VERSION=$( printf ' 0.0.%d' " $( date +%y%m%d%H%M) " )
25
+ if [ $# -ge 1 ]; then
26
+ VERSION=" $1 "
27
+ else
28
+ VERSION=$( printf ' 0.0.%d' " $( date +%y%m%d%H%M) " )
29
+ fi
19
30
TAG=" rust-v$VERSION "
20
31
git checkout -b " $TAG "
21
32
perl -i -pe " s/^version = \" .*\" /version = \" $VERSION \" /" Cargo.toml
You can’t perform that action at this time.
0 commit comments