Skip to content

Commit f79cc67

Browse files
committed
Add github workflows
1 parent ed9bae6 commit f79cc67

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Plugin Debug
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
11+
- labeled
12+
jobs:
13+
build:
14+
# Run on all label events (won't be duplicated) or all push events or on PR syncs not from the same repo
15+
if: github.repository_owner == 'OneLiteFeatherNET'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v3
20+
- name: Validate Gradle Wrapper
21+
uses: gradle/wrapper-validation-action@v1
22+
- name: Setup Java
23+
uses: actions/setup-java@v3
24+
with:
25+
distribution: temurin
26+
cache: gradle
27+
java-version: 17
28+
- name: Clean Build
29+
run: ./gradlew clean build --no-daemon
30+
- name: Determine release status
31+
if: ${{ runner.os == 'Linux' }}
32+
run: |
33+
if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then
34+
echo "STATUS=snapshot" >> $GITHUB_ENV
35+
else
36+
echo "STATUS=release" >> $GITHUB_ENV
37+
fi
38+
- name: Archive Artifacts
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: Plugin Debug Archive
42+
path: build/libs/plugin-debug-*.jar
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Close invalid PRs
2+
3+
on:
4+
pull_request_target:
5+
types: [ opened ]
6+
7+
jobs:
8+
run:
9+
if: ${{ github.repository != github.event.pull_request.head.repo.full_name && github.head_ref == 'main' }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: superbrothers/close-pull-request@v3
13+
with:
14+
comment: "Please do not open pull requests from the `main` branch, create a new branch instead."
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: draft release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
pull_request_target:
9+
types: [opened, reopened, synchronize]
10+
permissions:
11+
contents: read
12+
jobs:
13+
update_release_draft:
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: release-drafter/release-drafter@v5
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)