Skip to content

Commit fbd546b

Browse files
committed
chore: setup CI
1 parent a108b7f commit fbd546b

5 files changed

Lines changed: 142 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "maven" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: build-on-push
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
8+
jobs:
9+
build-on-push:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v4
18+
19+
- name: setup-jdk
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: 21
23+
distribution: 'temurin'
24+
cache: maven
25+
26+
- name: maven-build-verify
27+
run: mvn --batch-mode --update-snapshots clean verify
28+
29+
- name: upload-snapshot-to-maven-central
30+
run: mvn --batch-mode deploy
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: build-release-on-main-push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-release-on-main-push:
10+
if: ${{ !contains(github.event.head_commit.message, '[release]') }} # prevent recursive releases
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: write
15+
packages: write
16+
17+
steps:
18+
- name: checkout
19+
uses: actions/checkout@v4
20+
with:
21+
ref: main
22+
23+
- name: setup-jdk
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: 21
27+
distribution: 'temurin'
28+
cache: maven
29+
server-id: ossrh
30+
server-username: MAVEN_USERNAME
31+
server-password: MAVEN_PASSWORD
32+
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
33+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
34+
35+
- name: maven-build-verify
36+
run: mvn --batch-mode verify
37+
38+
- name: configure-git-user
39+
uses: qoomon/actions--setup-git@v1
40+
with:
41+
user: bot
42+
43+
- name: prepare-release
44+
run: mvn --batch-mode -P osslabz-release release:prepare -DskipStaging=true
45+
env:
46+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
47+
48+
- name: perform-release-publish-on-maven-central
49+
run: mvn --batch-mode -P osslabz-release release:perform
50+
env:
51+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
52+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
53+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
54+
55+
- name: 'get-latest-tag'
56+
id: 'get-latest-tag'
57+
uses: "WyriHaximus/github-action-get-previous-tag@v1"
58+
59+
- name: create-release-notes
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
generate_release_notes: true
63+
tag_name: ${{ steps.get-latest-tag.outputs.tag }}
64+
65+
- name: merge-main-to-dev
66+
run: |
67+
git fetch --unshallow
68+
git checkout dev
69+
git pull
70+
git merge --no-ff main -m "[release] auto-merge released main back to dev"
71+
git push
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: dependabot-pr-auto-merge
2+
3+
on: pull_request
4+
5+
6+
jobs:
7+
dependabot-pr-auto-merge:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
if: github.actor == 'dependabot[bot]'
15+
steps:
16+
- name: dependabot-pr-fetch-metadata
17+
uses: dependabot/fetch-metadata@v2
18+
19+
- name: dependabot-pr-approve
20+
run: gh pr review --approve "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
25+
- name: dependabot-pr-auto-merge
26+
run: gh pr merge --auto --merge "$PR_URL"
27+
env:
28+
PR_URL: ${{github.event.pull_request.html_url}}
29+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
<configuration>
314314
<tasks>
315315
<mkdir dir="${project.build.outputDirectory}" />
316-
<unzip src="lib/paapi5-java-sdk-1.2.2.jar.jar" dest="${project.build.outputDirectory}" />
316+
<unzip src="lib/paapi5-java-sdk-1.2.2.jar" dest="${project.build.outputDirectory}" />
317317
</tasks>
318318
</configuration>
319319
</execution>

0 commit comments

Comments
 (0)