Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Imvertor/Imvertor-Maven
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: Armatiek/Imvertor-Maven
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing with 162 additions and 11 deletions.
  1. +88 −0 .github/workflows/build-package-master.yml
  2. +15 −0 .github/workflows/purge-workflow-runs.yml
  3. BIN lib/eaapi.jar
  4. +59 −11 pom.xml
88 changes: 88 additions & 0 deletions .github/workflows/build-package-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build and Package master branch

on:
workflow_dispatch:
push:
branches:
- master
release:
types: [created]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Maven Clean
run: mvn clean

- name: Maven Install
run: mvn install

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Extract Maven project groupId
run: echo "maven_groupId=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.groupId}' --non-recursive exec:exec)" >> "$GITHUB_ENV"
- name: Extract Maven project artifactId
run: echo "maven_artifactId=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.artifactId}' --non-recursive exec:exec)" >> "$GITHUB_ENV"
- name: Extract Maven project version
run: echo "maven_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> "$GITHUB_ENV"

- name: Show extracted Maven project groupId, artifactId, version
run: printf '%s\n' "$maven_groupId" "$maven_artifactId" "$maven_version"

- name: Delete package or package version
uses: actions/github-script@v7
id: delete-package-version
with:
script: |
const packageName = process.env.maven_groupId + '.' + process.env.maven_artifactId
const org = context.repo.owner
const versionInfo = await github.rest.packages.getAllPackageVersionsForPackageOwnedByOrg({
package_type: 'maven',
package_name: packageName,
org: org,
})
const versions = versionInfo.data
for (const version of versions) {
if (version.name == process.env.maven_version) {
/* This version is the maven version we want to delete: */
if (versions.length == 1) {
/* This version is the last version of the package so we have to delete the complete package: */
await github.rest.packages.deletePackageForOrg({
package_type: 'maven',
package_name: packageName,
org: context.repo.owner,
});
} else {
/* Remove this version from the package: */
await github.rest.packages.deletePackageVersionForOrg({
package_type: 'maven',
package_name: packageName,
org: context.repo.owner,
package_version_id: version.id,
});
}
break;
}
}
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
15 changes: 15 additions & 0 deletions .github/workflows/purge-workflow-runs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Purge workflow runs
on:
workflow_dispatch:
schedule:
- cron: '45 3 * * *'
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Purge workflow runs
uses: boredland/action-purge-workflow-runs@main
with:
days-old: 5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file added lib/eaapi.jar
Binary file not shown.
70 changes: 59 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>Imvertor</groupId>
<artifactId>Imvertor</artifactId>
<version>1-SNAPSHOT</version>
<groupId>imvertor_arm</groupId>
<artifactId>imvertor_arm</artifactId>
<version>3.0.0</version>
<name>Imvertor</name>

<description>Imvertor under Maven</description>
@@ -202,15 +202,10 @@
<version>1.8.0-beta2</version>
</dependency>

<!-- non-mavenized depencies below; dependency on enterprise architect should be removed -->
<!-- note that they might have to distributed seperately due to copyright issues -->
<dependency>
<groupId>enterprise.architect</groupId>
<artifactId>java-api</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${env.EAPATH}/eaapi.jar</systemPath>
<!-- systemPath>C:\Program Files (x86)\Sparx Systems\EA\Java API\eaapi.jar</systemPath -->
<version>1.0.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.json/json -->
@@ -375,22 +370,43 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.1</version>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>Imvertor-1-SNAPSHOT-jar-with-dependencies</finalName>
<!--
<finalName>imvertor_mk-1-SNAPSHOT-jar-with-dependencies</finalName>
-->
<minimizeJar>true</minimizeJar>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>nl.imvertor.ChainTranslateAndReport</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<filter>
<artifact>org.eclipse.birt.runtime.3_7_1:org.apache.xerces</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>commons-jxpath:commons-jxpath</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>log4j:log4j</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
@@ -405,8 +421,40 @@
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>install-external</id>
<phase>clean</phase>
<configuration>
<file>${basedir}/lib/eaapi.jar</file>
<repositoryLayout>default</repositoryLayout>
<groupId>enterprise.architect</groupId>
<artifactId>java-api</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<generatePom>true</generatePom>
</configuration>
<goals>
<goal>install-file</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/armatiek/imvertor-maven</url>
</repository>
</distributionManagement>

<url>http://www.imvertor.org/</url>
</project>