From fb3b6e0a882c753cfe8519161ef67108074927ff Mon Sep 17 00:00:00 2001
From: querwurzel <>
Date: Sun, 22 Oct 2023 12:38:47 +0200
Subject: [PATCH] rename parent package
---
.github/workflows/build.yml | 21 ++++++++++++++++
.github/workflows/{main.yml => release.yml} | 28 ++++++++++++++-------
.gitignore | 1 +
backend/pom.xml | 5 ++--
frontend/pom.xml | 4 +--
pom.xml | 5 ++--
6 files changed, 49 insertions(+), 15 deletions(-)
create mode 100644 .github/workflows/build.yml
rename .github/workflows/{main.yml => release.yml} (50%)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..e73ab6f
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,21 @@
+name: build
+
+on:
+ workflow_dispatch:
+ push:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Set up JDK
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+
+ - name: Build with Maven
+ run: mvn clean package
diff --git a/.github/workflows/main.yml b/.github/workflows/release.yml
similarity index 50%
rename from .github/workflows/main.yml
rename to .github/workflows/release.yml
index e5403d2..4353ff2 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/release.yml
@@ -1,6 +1,10 @@
-name: CI
+name: release
-on: [push]
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
jobs:
build:
@@ -15,20 +19,26 @@ jobs:
distribution: 'temurin'
java-version: '17'
- - name: Build with Maven
- run: mvn clean package
-
- name: Publish package [on main]
- if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- mvn deploy -DskipTests -Denv=mysql
+ mvn deploy -DskipTests -Drevision=1.0.${{ github.run_number }} -Denv=mysql
+ - uses: actions/delete-package-versions@v4
+ with:
+ package-name: 'com.github.binpastes.app'
+ package-type: 'maven'
+ min-versions-to-keep: 10
+ - uses: actions/delete-package-versions@v4
+ if: github.ref == 'refs/heads/main'
+ with:
+ package-name: 'com.github.binpastes.frontend'
+ package-type: 'maven'
+ min-versions-to-keep: 10
- uses: actions/delete-package-versions@v4
if: github.ref == 'refs/heads/main'
with:
- package-name: 'com.github.binpastes.binpastes'
+ package-name: 'com.github.binpastes.backend'
package-type: 'maven'
min-versions-to-keep: 10
- ignore-versions: '1.0.0-SNAPSHOT'
diff --git a/.gitignore b/.gitignore
index b416b6a..481726f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@ target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
+pom.xml.versionsBackup
### STS ###
.apt_generated
diff --git a/backend/pom.xml b/backend/pom.xml
index 2a5a7c9..f4a6dc1 100644
--- a/backend/pom.xml
+++ b/backend/pom.xml
@@ -6,8 +6,8 @@
com.github.binpastes
- binpastes
- 1.0.0-SNAPSHOT
+ app
+ ${revision}
../pom.xml
@@ -17,6 +17,7 @@
com.github.binpastes
frontend
+ ${revision}
diff --git a/frontend/pom.xml b/frontend/pom.xml
index 4cec7af..3a53426 100644
--- a/frontend/pom.xml
+++ b/frontend/pom.xml
@@ -6,8 +6,8 @@
com.github.binpastes
- binpastes
- 1.0.0-SNAPSHOT
+ app
+ ${revision}
../pom.xml
diff --git a/pom.xml b/pom.xml
index 0d7ec5a..4dd75e9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,8 +11,8 @@
com.github.binpastes
- binpastes
- 1.0.0-SNAPSHOT
+ app
+ ${revision}
pom
BinPastes
@@ -31,6 +31,7 @@
UTF-8
+ 1.0.0-SNAPSHOT
17