Skip to content

Merge pull request #43 from sillydan1/dev #60

Merge pull request #43 from sillydan1/dev

Merge pull request #43 from sillydan1/dev #60

name: Build Release Artifacts
on:
push:
branches:
- main
tags:
- v*
jobs:
build-macos:
runs-on: macos-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: set up jdk 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
settings-path: ${{ github.workspace }}
- name: use gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: current
- name: build
run: gradle build
- name: jpackage
run: gradle jpackage
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: dmg
path: ${{ github.workspace }}/graphedit/build/jpackage/*.dmg
retention-days: 1
build-windows:
runs-on: windows-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: set up jdk 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
settings-path: ${{ github.workspace }}
- name: use gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: current
- name: build
run: gradle build
- name: jpackage
run: gradle jpackage
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: msi
path: ${{ github.workspace }}/graphedit/build/jpackage/*.msi
retention-days: 1
build-linux:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: set up jdk 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
settings-path: ${{ github.workspace }}
- name: use gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: current
- name: install build dependencies
run: sudo apt-get update && sudo apt-get install -y binutils dpkg dpkg-dev git fakeroot rpm make imagemagick inkscape
- name: create icon
run: make linuxIcon
- name: build
run: gradle build
- name: build javadoc
run: gradle javadoc
- name: jpackage
run: gradle jpackage
- name: repackage deb
run: |
REPACKAGE_DIR=$(mktemp -d)
DEB_NAME=$(ls graphedit/build/jpackage/graphedit_*.deb)
dpkg-deb -R $DEB_NAME $REPACKAGE_DIR
rm -rf $REPACKAGE_DIR/usr/lib/graphedit/*.desktop $REPACKAGE_DIR/usr/lib/graphedit/graphedit.png
mkdir -p "$REPACKAGE_DIR/usr/share/application/"
mkdir -p "$REPACKAGE_DIR/usr/share/icons/hicolor/scalable/apps/"
cp ${{ github.workspace }}/graphedit/src/main/resources/icon/master.svg $REPACKAGE_DIR/usr/share/icons/hicolor/scalable/apps/dk.gtz.graphedit.Graphedit.svg
cp ${{ github.workspace }}/graphedit/src/main/resources/dk.gtz.graphedit-Graphedit.desktop $REPACKAGE_DIR/usr/share/application/dk.gtz.graphedit-Graphedit.desktop
cp ${{ github.workspace }}/graphedit/src/main/resources/debian/postinst $REPACKAGE_DIR/DEBIAN/postinst
cp ${{ github.workspace }}/graphedit/src/main/resources/debian/prerm $REPACKAGE_DIR/DEBIAN/prerm
mkdir -p ${{ github.workspace }}/dist
fakeroot dpkg-deb --build "$REPACKAGE_DIR" "${{ github.workspace }}/dist/$(basename $DEB_NAME)"
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: deb
path: ${{ github.workspace }}/dist/*.deb
retention-days: 1
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: rpm
path: ${{ github.workspace }}/graphedit/build/jpackage/*.rpm
retention-days: 1
- name: installDist
run: gradle installDist
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: graphedit-bin-x86_64
path: ${{ github.workspace }}/graphedit/build/install/graphedit/
retention-days: 1
- name: log in to the container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: extract metadata (tags, labels) for docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
- name: build and push docker images
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}