Skip to content

Commit

Permalink
CI to handle versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
querwurzel committed Nov 7, 2023
1 parent d722af5 commit 62ee6f6
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 72 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,21 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn deploy -DskipTests -Drevision=1.0.${{ github.run_number }} -Denv=mysql
mvn versions:set -DnewVersion=1.0.${{ github.run_number }}
mvn -V deploy -DskipTests -Denv=mysql
- uses: actions/delete-package-versions@v4
with:
package-name: 'com.github.binpastes.app'
package-type: 'maven'
min-versions-to-keep: 10
min-versions-to-keep: 3
- uses: actions/delete-package-versions@v4
with:
package-name: 'com.github.binpastes.frontend'
package-type: 'maven'
min-versions-to-keep: 10
min-versions-to-keep: 3
- uses: actions/delete-package-versions@v4
with:
package-name: 'com.github.binpastes.backend'
package-type: 'maven'
min-versions-to-keep: 10
min-versions-to-keep: 3
13 changes: 11 additions & 2 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.github.binpastes</groupId>
<artifactId>app</artifactId>
<version>${revision}</version>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -17,7 +17,6 @@
<dependency>
<groupId>com.github.binpastes</groupId>
<artifactId>frontend</artifactId>
<version>${revision}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -102,6 +101,16 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
152 changes: 88 additions & 64 deletions frontend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,96 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.github.binpastes</groupId>
<artifactId>app</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<parent>
<groupId>com.github.binpastes</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>frontend</artifactId>
<artifactId>frontend</artifactId>

<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<nodeVersion>v18.16.1</nodeVersion>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>pnpm install</id>
<goals>
<goal>npx</goal>
</goals>
<configuration>
<arguments>pnpm install</arguments>
</configuration>
</execution>
<execution>
<id>pnpm build</id>
<goals>
<goal>npx</goal>
</goals>
<configuration>
<arguments>pnpm run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<nodeVersion>v18.18.2</nodeVersion>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>pnpm install</id>
<goals>
<goal>npx</goal>
</goals>
<configuration>
<arguments>pnpm install</arguments>
</configuration>
</execution>
<execution>
<id>pnpm build</id>
<goals>
<goal>npx</goal>
</goals>
<configuration>
<arguments>pnpm run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
<execution>
<id>default-testCompile</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
13 changes: 11 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.github.binpastes</groupId>
<artifactId>app</artifactId>
<version>${revision}</version>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>BinPastes</name>

Expand All @@ -31,7 +31,6 @@
<properties>
<!-- maven property definition -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>1.0.0-SNAPSHOT</revision>

<!-- java version properties -->
<maven.compiler.target>17</maven.compiler.target>
Expand Down Expand Up @@ -91,6 +90,16 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<executions>
<execution>
<id>default-deploy</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 62ee6f6

Please sign in to comment.