Adds github actions.
This commit is contained in:
45
.github/workflows/gradle.yml
vendored
Normal file
45
.github/workflows/gradle.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "develop" ]
|
||||
pull_request:
|
||||
branches: [ "develop" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Set up JDK 25
|
||||
uses: actions/setup-java@v6
|
||||
with:
|
||||
java-version: '25'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Setup Gradle 9.8.0
|
||||
uses: gradle/actions/setup-gradle@v5
|
||||
with:
|
||||
gradle-version: '9.8.0'
|
||||
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
|
||||
|
||||
- name: Build with Gradle Wrapper
|
||||
run: ./tools/build-plugin.sh
|
||||
|
||||
- name: Extract Project Version
|
||||
id: project_info
|
||||
run: |
|
||||
VERSION=$(./gradlew properties --no-daemon -q | awk -F ': ' '$1 == "version" {print $2}')
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Upload Plugin Artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: Metropolis-${{ steps.project_info.outputs.version }}
|
||||
path: build/libs/*.jar
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
Reference in New Issue
Block a user