Skip to content

Merge pull request #28 from sillydan1/sillydan1-patch-1 #48

Merge pull request #28 from sillydan1/sillydan1-patch-1

Merge pull request #28 from sillydan1/sillydan1-patch-1 #48

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@v3
- name: set up jdk 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
settings-path: ${{ github.workspace }}
- name: use gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
gradle-version: current
- name: build
run: gradle build
- name: jpackage
run: gradle jpackage
- name: upload artifacts
uses: actions/upload-artifact@v3
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@v3
- name: set up jdk 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
settings-path: ${{ github.workspace }}
- name: use gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
gradle-version: current
- name: build
run: gradle build
- name: jpackage
run: gradle jpackage
- name: upload artifacts
uses: actions/upload-artifact@v3
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@v3
- name: set up jdk 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
settings-path: ${{ github.workspace }}
- name: use gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
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@v3
with:
name: deb
path: ${{ github.workspace }}/dist/*.deb
retention-days: 1
- name: upload artifacts
uses: actions/upload-artifact@v3
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@v3
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@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: extract metadata (tags, labels) for docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
ghcr.io/${{ github.repository }}
- name: build and push docker images
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
file: ./Dockerfile
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}