Add support for nightly builds
This commit is contained in:
29
.github/workflows/build.yml
vendored
29
.github/workflows/build.yml
vendored
@@ -4,6 +4,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
schedule:
|
||||||
|
- cron: '*/15 * * * *'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -30,10 +32,30 @@ jobs:
|
|||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check for New Commits (Nightly Only)
|
||||||
|
id: check
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
|
continue-on-error: false
|
||||||
|
run: |
|
||||||
|
# 3AM CET
|
||||||
|
# date -d 'yesterday' +%Y-%m-%dT02:00:0
|
||||||
|
since="$(date -d 'yesterday' +%Y-%m-%d) 02:00:00"
|
||||||
|
count=$(git rev-list --count --since="$since" --until=now HEAD)
|
||||||
|
if [ "$count" -gt 0 ]; then
|
||||||
|
echo "new_commits=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "no new commits found for nightly build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Generate build variables
|
- name: Generate build variables
|
||||||
id: prep
|
id: prep
|
||||||
run: |
|
run: |
|
||||||
|
if [ "${{ github.event_name }}" = "schedule" ]; then
|
||||||
|
echo "version=$(date +'%Y.%m.%d-nightly')" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
echo "version=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
|
echo "version=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
echo "built_at=$(date +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_OUTPUT
|
echo "built_at=$(date +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_OUTPUT
|
||||||
echo "git_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
echo "git_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
@@ -91,7 +113,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Set version
|
- name: Set version
|
||||||
id: version
|
id: version
|
||||||
run: echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/})"
|
run: |
|
||||||
|
if [ "${{ github.event_name }}" = "schedule" ]; then
|
||||||
|
echo "version=$(date +'%Y.%m.%d-nightly')" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "version=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
|||||||
Reference in New Issue
Block a user