Skip to content

Nightly Build

Nightly Build #77

Workflow file for this run

name: Nightly Build
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
inputs:
publishToMarketPlace:
description: 'Publish to JetBrains Marketplace ?'
required: true
type: choice
options:
- 'true'
- 'false'
default: 'false'
jobs:
should-build-change:
runs-on: ubuntu-latest
outputs:
repo-cache-hit: ${{ steps.cache-last-commit.outputs.cache-hit }}
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: validate Gradle Wrapper
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 #v2.1.1
- run: |
git rev-parse HEAD >> lastCommit
- name: Check New Changes
id: cache-last-commit
uses: actions/cache@v4
with:
path: lastCommit
key: lastCommit-${{ hashFiles('lastCommit') }}
# Prepare and publish the plugin to JetBrains Marketplace repository
pre-release:
needs: should-build-change
if: ${{ needs.should-build-change.outputs.repo-cache-hit != 'true' || github.event_name != 'schedule' }}
name: Publish Plugin
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 #v3.1.0
with:
gradle-home-cache-cleanup: true
- name: Publish Plugin
env:
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }}
run: |
CURRENT_VERSION=$(grep "projectVersion=" gradle.properties | cut -d'=' -f2)
BASE_VERSION=${CURRENT_VERSION%-SNAPSHOT}
TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
PLUGIN_VERSION="${BASE_VERSION}-${TIMESTAMP}"
./gradlew publishPlugin -PjetBrainsToken=$PUBLISH_TOKEN -PprojectVersion=${PLUGIN_VERSION} -PjetBrainsChannel=nightly