pre-release #700
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: pre-release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '00 20 * * *' # runs daily at 20:00 UTC | |
jobs: | |
pre-release: | |
name: Pre Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required to count the commits | |
submodules: true | |
- name: Setup jdk11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Get new commits | |
run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_ENV | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" | |
- name: Set Version | |
run: | | |
sed -i "s/\(project.version=\).*/\1nightly-$date/g" src/main/resources/application.properties | |
- name: Setup gradle | |
if: ${{ env.NEW_COMMIT_COUNT > 0 }} | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
- name: Build & Test | |
if: ${{ env.NEW_COMMIT_COUNT > 0 }} | |
run: ./gradlew genTsTypes build | |
- name: Store reports | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reports | |
path: build/reports/ | |
- name: Save dist zip | |
if: ${{ env.NEW_COMMIT_COUNT > 0 }} | |
run: cp build/distributions/*.zip . | |
- uses: marvinpinto/[email protected] | |
if: ${{ env.NEW_COMMIT_COUNT > 0 }} | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "nightly-${{ env.date }}" | |
title: "Nightly ${{ env.date }}" | |
prerelease: true | |
files: | | |
*.zip |