Skip to content

Nightly build

Nightly build #323

Workflow file for this run

name: Nightly build
on:
schedule:
# At 00:00 on every day-of-week from Tuesday through Saturday.
- cron: '0 0 * * 2-6'
workflow_dispatch:
jobs:
nightly-build:
name: Push tag for nightly build
runs-on: ubuntu-latest
steps:
-
name: 'Checkout'
uses: actions/checkout@v3
with:
token: ${{ secrets.MEROXA_MACHINE }}
fetch-depth: 0
-
name: 'Push new tag'
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
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]}'`
MINOR_VERSION="$((${MINOR_VERSION} + 1))"
TAG="${MAJOR_VERSION}.${MINOR_VERSION}.0-nightly.$(date +'%Y%m%d')"
git tag -a $TAG -m "$TAG: nightly build"
git push origin $TAG
- name: 'Clean up nightly releases'
uses: dev-drprasad/[email protected]
with:
keep_latest: 5
delete_tags: true
delete_tag_pattern: nightly
env:
GITHUB_TOKEN: ${{ secrets.MEROXA_MACHINE }}