feat: add github workflow config

This commit is contained in:
guqing
2022-07-08 16:06:20 +08:00
parent 781478df3a
commit 268b03a6ff
2 changed files with 53 additions and 1 deletions

53
.github/workflows/workflow.yaml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Build Plugin JAR
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-links jar
uses: actions/upload-artifact@v2
with:
name: halo-plugin-template
path: |
build/libs
retention-days: 1