mirror of
https://github.com/halo-dev/plugin-starter.git
synced 2026-01-15 06:05:13 +08:00
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: Build Plugin JAR File
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: 'temurin'
|
|
cache: 'gradle'
|
|
java-version: 17
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
- uses: pnpm/action-setup@v2.0.1
|
|
name: Install pnpm
|
|
id: pnpm-install
|
|
with:
|
|
version: 7
|
|
run_install: false
|
|
- name: Get pnpm store directory
|
|
id: pnpm-cache
|
|
run: |
|
|
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
|
|
- uses: actions/cache@v3
|
|
name: Setup pnpm cache
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/admin-frontend/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
- name: Install Frontend Dependencies
|
|
run: |
|
|
./gradlew pnpmInstall
|
|
- name: Build with Gradle
|
|
run: |
|
|
./gradlew clean build -x test
|
|
- name: Archive plugin-starter jar
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: plugin-starter
|
|
path: |
|
|
build/libs/*-plain.jar
|
|
retention-days: 1
|