Skip to content

Commit

Permalink
Add packaging to zip within releases #1
Browse files Browse the repository at this point in the history
  • Loading branch information
durasj committed Apr 18, 2021
1 parent cfd9d52 commit bb7e080
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Package

on: [push]

jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Package with Maven
run: mvn -B -C -V package

- name: Create Release on Tag
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
prerelease: true
files: target/*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 20 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.octosign</groupId>
<artifactId>whitelabel</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Octosign White Label Signer</name>
Expand Down Expand Up @@ -219,6 +219,25 @@
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>create-archive</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
34 changes: 34 additions & 0 deletions src/assembly/bin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
<id>bin</id>
<formats>
<format>zip</format>
<!-- You can add format dir here if you want to use it for further packaging -->
</formats>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/dependency-jars</directory>
<outputDirectory>/dependency-jars</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/preparedJDK</directory>
<outputDirectory>/preparedJDK</outputDirectory>
</fileSet>
</fileSets>
</assembly>

0 comments on commit bb7e080

Please sign in to comment.