Skip to content

Commit

Permalink
feat: add github action workflow yml configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
li-guohao committed Nov 2, 2023
1 parent 9086a3b commit 97c2ed4
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 2 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci_build_jar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This is a basic workflow to help you get started with Actions

name: Build FastJar

# Controls when the workflow will run
on:
release:
types: [published]

jobs:

release:
if: github.repository == 'ikaros-dev/plugin-bgmtv'
name: Build with java 17 and upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Git submodule init
uses: snickerbockers/submodules-init@v4
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
cache: 'gradle'
java-version: 17
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Clean with gradle
run: |
./gradlew clean
- name: Build console with npm
run: |
./gradlew buildFrontend -x test
- name: Build server with gradle
run: |
./gradlew build -x test
- name: Get Project Version
id: get_version
run: echo "::set-output name=version::$(cat gradle.properties | grep ^version= | cut -d'=' -f2)"
- name: Upload lib jar to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.LI_GUOHAO_TOKEN }}
file: /home/runner/work/plugin-bgmtv/plugin-bgmtv/build/libs/plugin-bgmtv-${{steps.get_version.outputs.version}}.jar
asset_name: plugin-bgmtv-${{steps.get_version.outputs.version}}.jar




71 changes: 71 additions & 0 deletions .github/workflows/ci_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This is a basic workflow to help you get started with Actions

name: Server CI

# Controls when the workflow will run
on:
push:
branches:
- master
paths:
- "**"
- '!console/**'
- "!**.md"
pull_request:
branches:
- master
- release-*
paths:
- "**"
- '!console/**'
- "!**.md"

jobs:
checkConsole:
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: Make gradlew executable
run: chmod +x ./gradlew
- name: Build console with npm
run: |
./gradlew buildFrontend -x test
test:
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: Make gradlew executable
run: chmod +x ./gradlew
- name: Run tests
run: ./gradlew test
- name: Generate jacoco unit test coverage report xml
run: ./gradlew jacocoTestReport
- name: Upload build dir if current step run failed.
uses: actions/upload-artifact@v3.1.2
if: ${{ failure() }}
with:
# Artifact name
name: testBuild
# A file, directory or wildcard pattern that describes what to upload
path: /home/runner/work/plugin-bgmtv/plugin-bgmtv/build
# The desired behavior if no files are found using the provided path.
if-no-files-found: warn
# Duration after which artifact will expire in days. 0 means using default retention.Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
retention-days: 7

28 changes: 28 additions & 0 deletions .github/workflows/ci_release_by_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create Release

permissions:
contents: write

on:
push:
tags:
- v[0-9]+.*

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
# (Optional)
changelog: CHANGELOG.MD
# (Optional) Create a draft release.
# [default value: false]
draft: false
# (Optional) Format of title.
# [default value: $tag]
# [possible values: variables $tag, $version, and any string]
title: v$version
# (Required) GitHub token for creating GitHub Releases.
token: ${{ secrets.LI_GUOHAO_TOKEN }}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=run.ikaros.plugin
description=A bgmtv plugin for ikaros.
version=0.11.7
version=0.11.8
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: PluginBgmTv
# plugin entry class that extends BasePlugin
clazz: run.ikaros.plugin.bgmtv.BgmTvPlugin
# plugin 'version' is a valid semantic version string (see semver.org).
version: 0.11.7
version: 0.11.8
requires: ">=0.11.4"
author:
name: Ikaros OSS Team
Expand Down

0 comments on commit 97c2ed4

Please sign in to comment.