Skip to content

Commit

Permalink
Add web build to release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Degubi committed Oct 21, 2023
1 parent 951642a commit 8056a47
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 38 deletions.
101 changes: 64 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 21

- name: Build installer
run: |
mvn -f lib/pom.xml clean install --% -Dmaven.test.skip=true
cd desktop
jlink --output ./runtime/ --no-man-pages --no-header-files --add-modules java.base,java.desktop,java.sql,java.net.http,jdk.crypto.ec --compress=2
mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=resources
mvn package
move target/PDFTableExtractor-1.0.jar resources/PDFTableExtractor.jar
mvn clean package
move target/PDFTableExtractorDesktop-1.0.0.jar resources/PDFTableExtractor.jar
jpackage --runtime-image runtime --input resources --main-class pdftableextractordesktop.Main --main-jar PDFTableExtractor.jar --name PDFTableExtractor --vendor Degubi --description PDFTableExtractor --icon icon.ico --win-per-user-install --win-dir-chooser --win-shortcut --win-console
- name: Upload installer to release
Expand All @@ -33,41 +34,67 @@ jobs:
tag: ${{ github.ref }}

build_desktop_linux:
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 21
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 21

- name: Build installer
run: |
cd desktop
jlink --output ./runtime/ --no-man-pages --no-header-files --add-modules java.base,java.desktop,java.sql,java.net.http,jdk.crypto.ec --compress=2
mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=resources
mvn package
mv target/PDFTableExtractorDesktop-1.0.0.jar resources/PDFTableExtractor.jar
jpackage --runtime-image runtime --input resources --main-class pdftableextractordesktop.Main --main-jar PDFTableExtractor.jar --name PDFTableExtractor --vendor Degubi --description PDFTableExtractor --icon icon.png --linux-shortcut
- name: Build installer
run: |
mvn -f lib/pom.xml clean install -Dmaven.test.skip=true
cd desktop
jlink --output ./runtime/ --no-man-pages --no-header-files --add-modules java.base,java.desktop,java.sql,java.net.http,jdk.crypto.ec --compress=2
mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=resources
mvn clean package
mv target/PDFTableExtractorDesktop-1.0.0.jar resources/PDFTableExtractor.jar
jpackage --runtime-image runtime --input resources --main-class pdftableextractordesktop.Main --main-jar PDFTableExtractor.jar --name PDFTableExtractor --vendor Degubi --description PDFTableExtractor --icon icon.png --linux-shortcut
- name: Modify installer (add Terminal=True & add to right click context menu)
run: |
mkdir extract
ar x --output extract pdftableextractor_1.0_amd64.deb
cd extract
zstd -d data.tar.zst
tar -xf data.tar
sed -i 's/Terminal=false/Terminal=true/' opt/pdftableextractor/lib/pdftableextractor-PDFTableExtractor.desktop
sed -i 's/Exec=\/opt\/pdftableextractor\/bin\/PDFTableExtractor/Exec=\/opt\/pdftableextractor\/bin\/PDFTableExtractor %U/' opt/pdftableextractor/lib/pdftableextractor-PDFTableExtractor.desktop
tar -cf data.tar opt
yes | zstd -z data.tar
cd ..
ar r PDFTableExtractor.deb extract/debian-binary extract/control.tar.zst extract/data.tar.zst
- name: Modify installer (add Terminal=True & add to right click context menu)
run: |
cd desktop
mkdir extract
ar x --output extract pdftableextractor_1.0_amd64.deb
cd extract
zstd -d data.tar.zst
tar -xf data.tar
sed -i 's/Terminal=false/Terminal=true/' opt/pdftableextractor/lib/pdftableextractor-PDFTableExtractor.desktop
sed -i 's/Exec=\/opt\/pdftableextractor\/bin\/PDFTableExtractor/Exec=\/opt\/pdftableextractor\/bin\/PDFTableExtractor %U/' opt/pdftableextractor/lib/pdftableextractor-PDFTableExtractor.desktop
tar -cf data.tar opt
yes | zstd -z data.tar
cd ..
ar r PDFTableExtractor.deb extract/debian-binary extract/control.tar.zst extract/data.tar.zst
- name: Upload installer to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: desktop/PDFTableExtractor.deb
tag: ${{ github.ref }}
- name: Upload installer to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: desktop/PDFTableExtractor.deb
tag: ${{ github.ref }}

build_web:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 21

- name: Build application
run: |
mvn -f lib/pom.xml clean install -Dmaven.test.skip=true
cd web
mvn clean package
- name: Upload application to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: web/target/PDFTableExtractorWeb-1.0.0.jar
asset_name: PDFTableExtractorWeb.jar
tag: ${{ github.ref }}
2 changes: 1 addition & 1 deletion desktop/src/main/java/pdftableextractordesktop/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import javax.swing.*;

public final class Main {
public static final String VERSION = "1.3.0";
public static final String VERSION = "1.3.1";
public static final Jsonb json = JsonbBuilder.create(new JsonbConfig().withFormatting(Boolean.TRUE));

public static void main(String[] args) throws Exception {
Expand Down

0 comments on commit 8056a47

Please sign in to comment.