Skip to content

Commit

Permalink
Added github actions build and release
Browse files Browse the repository at this point in the history
  • Loading branch information
Donkie committed Jan 23, 2021
1 parent 9f37243 commit ff1d73c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 30 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

name: Build

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Log java version
run: java -version && mvn --version
- name: Build
run: mvn --no-transfer-progress package
- uses: actions/upload-artifact@v2
with:
name: Package
path: target/BungeeGCloud-*.jar
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Create Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest

name: Build & Release

steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Log java version
run: java -version && mvn --version
- name: Build
run: mvn --activate-profiles release --no-transfer-progress package
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/BungeeGCloud.jar
asset_name: BungeeGCloud.jar
asset_content_type: application/java-archive

# - uses: actions/upload-artifact@v2
# with:
# name: Package
# path: target/BungeeGCloud-*.jar
39 changes: 9 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>donkie</groupId>
<artifactId>BungeeGCloud</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand All @@ -22,6 +22,7 @@
<jacoco.unit-tests.limit.class-complexity>20</jacoco.unit-tests.limit.class-complexity>
<jacoco.unit-tests.limit.method-complexity>5</jacoco.unit-tests.limit.method-complexity>
</properties>

<reporting>
<plugins>
<plugin>
Expand All @@ -31,26 +32,16 @@
</plugin>
</plugins>
</reporting>

<profiles>
<!-- Publish coverage report to Coveralls, only when running in Travis. -->
<profile>
<id>travis</id>
<activation>
<property>
<name>env.TRAVIS</name>
</property>
</activation>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${coveralls-maven-plugin.version}</version>
</plugin>
</plugins>
<finalName>${project.artifactId}</finalName>
</build>
</profile>
</profiles>

<repositories>
<repository>
<id>bungeecord-repo</id>
Expand All @@ -73,32 +64,20 @@
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<!--<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>-->
</plugins>
</build>

Expand Down

0 comments on commit ff1d73c

Please sign in to comment.