Skip to content

Commit

Permalink
Compile game on new master commit (#2)
Browse files Browse the repository at this point in the history
* Compile on new commit to main

* Package game on new master commit
  • Loading branch information
Mw3y authored May 18, 2024
1 parent 27e733e commit bdc1886
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 17 deletions.
47 changes: 37 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
name: Build on Release
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
release:
types: [published]
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Cache the Maven packages to speed up build
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

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

- name: Create staging directory and copy jars
run: mkdir staging && cp icmon/target/*jar-with-dependencies.jar staging

- name: Package application
uses: actions/upload-artifact@v1
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn clean install
name: Ic(e)Mon
path: staging
27 changes: 21 additions & 6 deletions icmon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<artifactId>icmon</artifactId>
<version>1.0.0-provided</version>
<version>1.0.0-release</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand All @@ -30,11 +30,26 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<source>17</source>
<target>17</target>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>ch.epfl.cs107.Play</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<!--
Expand Down Expand Up @@ -70,4 +85,4 @@
</dependency>
</dependencies>

</project>
</project>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ch.epfl.cs107</groupId>
<artifactId>mp2</artifactId>
<version>1.0.0</version>
<version>2023</version>
<packaging>pom</packaging>

<properties>
Expand Down

0 comments on commit bdc1886

Please sign in to comment.