-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 1.58 KB
/
nightly.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Publish Nightly
on:
schedule:
- cron: '30 19 * * *'
permissions:
id-token: write
contents: write
checks: write
jobs:
evaluate_changes:
name: Evaluate changes for run or skipping nightly build
runs-on: ubuntu-latest
outputs:
SHOULD_BUILD: ${{ steps.check.outputs.shouldBuild }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Check
id: check
run: |
if [[ $(git rev-list --after="24 hours" main) ]]; then
echo ::set-output name=shouldBuild::true
else
echo ::set-output name=shouldBuild::false
fi
build:
name: Build
needs: evaluate_changes
if: ${{ needs.evaluate_changes.outputs.SHOULD_BUILD == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 18
- name: Build
uses: gradle/gradle-build-action@v2
with:
gradle-version: current
arguments: build
create_tag:
name: Nightly Tag
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create TAG_NAME environment variable
run: |
echo "TAG_NAME=nightly-$(date --rfc-3339=date)" >> $GITHUB_ENV
- name: Create tag
uses: rickstaa/action-create-tag@v1
env:
TAG_NAME: ${{ env.TAG_NAME }}
with:
tag: ${{ env.TAG_NAME }}