Skip to content

Commit

Permalink
Add CI workflows and update Gradle build script
Browse files Browse the repository at this point in the history
Introduce GitHub Actions workflows for testing on merge and publishing on alpha tags. Update `build.gradle.kts` to support dynamic plugin channels. Changes also include adjustments to project configuration in `.idea/workspace.xml`.
  • Loading branch information
cortiz committed Sep 6, 2024
1 parent a65d67e commit 1ba536e
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 36 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy-alpha.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test and Publish

on:
push:
branches:
- main
tags:
- 'alpha-*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Run tests
run: ./gradlew test

publish:
if: startsWith(github.ref, 'refs/tags/alpha')
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Publish Plugin
run: ./gradlew publishPlugin
env:
PLUGIN_REPO: ${{ secrets.PLUGIN_REPO }}
PLUGIN_TOKEN: ${{ secrets.PLUGIN_TOKEN }}
39 changes: 39 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test on Merge

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Run tests
run: ./gradlew test
Loading

0 comments on commit 1ba536e

Please sign in to comment.