nightly #155
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "[email protected]" | |
# 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 |