-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (32 loc) · 1.19 KB
/
nightly_v21.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: nightly
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * 2-6'
jobs:
trigger-nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ssh-key: "${{ secrets.NIGHTLY_BUILD_KEY }}"
fetch-depth: 0
- name: Push nightly tag
shell: bash
run: |
git config --global user.name "Soule BA"
git config --global user.email "soule@weave.works"
# Get the latest release tag
DESCRIBE=$(git tag -l --sort=-v:refname | grep -v nightly | head -n 1)
MAJOR_VERSION=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}')
MINOR_VERSION=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}')
PATCH_VERSION=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[3]}')
PATCH_NUMBER=$(echo $DESCRIBE | awk '{split($0,a,"."); print a[4]}')
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}"
if [[ "$PATCH_NUMBER" =~ ^[0-9]+$ ]]; then
TAG="${TAG}.${PATCH_NUMBER}"
fi
TAG="${TAG}.nightly.$(date +'%Y%m%d')"
git tag -a $TAG -m "$TAG: nightly build"
git push origin $TAG