Skip to content

Commit

Permalink
Add Build Config
Browse files Browse the repository at this point in the history
  • Loading branch information
Konloch committed Oct 7, 2023
1 parent 38de817 commit a52dbd5
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This will build the repo and upload the package as an artifact

name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11', '17' ] # LTS versions

steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract Maven project version
run: echo "lib_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
id: project
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
if: ${{ matrix.java == '8' }}
with:
name: Malbolge-${{ env.lib_version }}-SNAPSHOT
path: target/Malbolge-${{ env.lib_version }}.jar
retention-days: 7
120 changes: 120 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>

<groupId>com.konloch</groupId>
<artifactId>Malbolge</artifactId>
<version>0.0.1</version>

<name>Malbolge</name>
<description>Malbolge '98 interpreter ported over to Java.</description>
<url>https://konloch.com/Malbolge.c4J/</url>
<inceptionYear>2023</inceptionYear>

<licenses>
<license>
<name>Creative Commons Attribution 4.0 International License</name>
<url>https://creativecommons.org/licenses/by/4.0/</url>
</license>
</licenses>

<organization>
<name>Konloch</name>
<url>https://konloch.com</url>
</organization>

<developers>
<developer>
<name>Konloch</name>
<email>konloch@gmail.com</email>
<url>https://konloch.com</url>
<organization>Konloch</organization>
<organizationUrl>https://konloch.com</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/Konloch/Malbolge.c4J.git</connection>
<developerConnection>scm:git:ssh://github.com:Konloch/Malbolge.c4J.git</developerConnection>
<url>http://github.com/Konloch/Malbolge.c4J/tree/master</url>
</scm>

<properties>
<java.version>1.8</java.version>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<source>${maven.compiler.source}</source>
</configuration>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.konloch.malbolge.MalbolgeC4J</Main-Class>
<Implementation-Version>${project.version}</Implementation-Version>
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
</manifestEntries>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</plugin>
</plugins>
</build>
</project>

0 comments on commit a52dbd5

Please sign in to comment.