File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,17 +214,29 @@ jobs:
214214 with :
215215 node-version : 22
216216
217- - run : echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
218- if : github.ref == 'refs/heads/release'
219- - run : echo "TAG=nightly" >> $GITHUB_ENV
220- if : github.ref != 'refs/heads/release'
221- - run : ' echo "TAG: $TAG"'
222-
223217 - name : Checkout repository
224218 uses : actions/checkout@v6
225219 with :
226220 fetch-depth : ${{ env.FETCH_DEPTH }}
227221
222+ - name : Set release tag
223+ run : |
224+ if [ "${{ github.ref }}" = "refs/heads/release" ]; then
225+ git fetch --tags
226+ today=$(date --iso -u)
227+ last_tag=$(git tag -l "${today}*" | sort -V | tail -n1)
228+ if [ -n "$last_tag" ]; then
229+ last_v=$(echo "$last_tag" | grep -oP '(?<=\.)\d+' || echo 0)
230+ new_v=$(($last_v + 1))
231+ tag="${today}.${new_v}"
232+ else
233+ tag="$today"
234+ fi
235+ echo "TAG=$tag" >> $GITHUB_ENV
236+ else
237+ echo "TAG=nightly" >> $GITHUB_ENV
238+ fi
239+
228240 - run : echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
229241 - run : ' echo "HEAD_SHA: $HEAD_SHA"'
230242
Original file line number Diff line number Diff line change @@ -91,5 +91,8 @@ fn date_iso(sh: &Shell) -> anyhow::Result<String> {
9191}
9292
9393fn is_release_tag ( tag : & str ) -> bool {
94- tag. len ( ) == "2020-02-24" . len ( ) && tag. starts_with ( |c : char | c. is_ascii_digit ( ) )
94+ tag. len ( ) >= 10
95+ && tag. starts_with ( |c : char | c. is_ascii_digit ( ) )
96+ && tag. as_bytes ( ) [ 4 ] == b'-'
97+ && tag. as_bytes ( ) [ 7 ] == b'-'
9598}
You can’t perform that action at this time.
0 commit comments