Skip to content

Commit 8fd9cd7

Browse files
committed
Update CI, add Dependabot
1 parent 47b7ab1 commit 8fd9cd7

File tree

4 files changed

+50
-41
lines changed

4 files changed

+50
-41
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
- package-ecosystem: "maven"
8+
directory: "/"
9+
schedule:
10+
interval: "monthly"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Auto-merge Dependabot PRs
2+
3+
on:
4+
workflow_run:
5+
workflows: [ "Pull Request" ]
6+
types: [ completed ]
7+
8+
jobs:
9+
automerge-dependabot-pr:
10+
if: "github.actor == 'dependabot[bot]'
11+
&& github.event.workflow_run.event == 'pull_request'
12+
&& github.event.workflow_run.conclusion == 'success'"
13+
uses: Jikoo/PlanarActions/.github/workflows/pr_automerge_complete.yml@master
14+
with:
15+
triggering-workflow-run: ${{ github.event.workflow_run.id }}

.github/workflows/ci.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,37 @@
1-
name: CI
1+
name: Build
22

33
on:
44
push:
5-
pull_request_target:
5+
branches-ignore:
6+
- dependabot/**
67

78
jobs:
8-
build:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Checkout Code
12-
uses: actions/checkout@v2
13-
14-
- name: Set Up Java
15-
uses: actions/setup-java@v2
16-
with:
17-
distribution: 'adopt'
18-
java-version: '17'
19-
20-
# Use cache to speed up build
21-
- name: Cache Maven Repo
22-
uses: actions/cache@v2
23-
id: cache
24-
with:
25-
path: ~/.m2/repository
26-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
27-
28-
- name: Build With Maven
29-
run: mvn -e clean package -am -P all
30-
31-
# Upload artifacts
32-
- name: Upload Distributable Jar
33-
id: upload-final
34-
uses: actions/upload-artifact@v2
35-
with:
36-
name: dist
37-
path: ./target/AnvilUnlocker.jar
9+
run-ci:
10+
uses: Jikoo/PlanarActions/.github/workflows/ci_maven.yml@master
3811

3912
release:
4013
name: Create Github Release
41-
needs: [ build ]
14+
needs: [ run-ci ]
4215
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
4316
runs-on: ubuntu-latest
4417
steps:
45-
- name: Checkout Code
46-
uses: actions/checkout@v2
47-
with:
48-
fetch-depth: 0
49-
5018
- name: Download Artifacts
51-
uses: actions/download-artifact@v2
19+
uses: actions/download-artifact@v4
20+
with:
21+
name: ${{ github.event.repository.name }}-ci
22+
path: ${{ github.event.repository.name }}-ci
5223

5324
- name: Parse Tag Name
5425
id: get_version
5526
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
5627

5728
- name: Create Release
5829
id: create-release
59-
uses: softprops/action-gh-release@v0.1.5
30+
uses: softprops/action-gh-release@v2.1.0
6031
env:
6132
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6233
with:
6334
name: AnvilUnlocker ${{ steps.get_version.outputs.result }}
6435
draft: true
6536
prerelease: true
66-
files: ./dist/AnvilUnlocker.jar
37+
files: ./${{ github.event.repository.name }}-ci/AnvilUnlocker.jar

.github/workflows/pull_request.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
run-ci:
8+
uses: Jikoo/PlanarActions/.github/workflows/ci_maven.yml@master
9+
store-dependabot-pr-data:
10+
if: "github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'"
11+
uses: Jikoo/PlanarActions/.github/workflows/pr_automerge_prep.yml@master
12+
with:
13+
pr-number: ${{ github.event.number }}

0 commit comments

Comments
 (0)