Skip to content

Add open settings keyboard shortcut. (#106) #254

Add open settings keyboard shortcut. (#106)

Add open settings keyboard shortcut. (#106) #254

Workflow file for this run

name: Build
on:
push:
branches:
- master
tags:
- 'v*.*.*'
paths-ignore:
- .dockerignore
- .gitignore
- Dockerfile
- LICENSE
- README.md
- demo-media/*
- chocolatey/**
pull_request:
branches:
- master
env:
JAVA_VERSION: '17.0.8+7'
JAVA_DISTRIBUTION: 'temurin'
TEST_SCREEN_WIDTH: '1920'
TEST_SCREEN_HEIGHT: '1080'
jobs:
Build-and-Test-Windows:
runs-on: windows-latest
name: Build and Test (Windows)
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: gradle
- name: Verify Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build
run: ./gradlew --info --stacktrace build -x test
- name: Test setup
run: |
choco install -y change-screen-resolution
changescreenresolution $TEST_SCREEN_WIDTH $TEST_SCREEN_HEIGHT
- name: Test
id: test
run: ./gradlew --info --stacktrace test
- name: Upload failed test screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: failed-test-screenshots-windows
path: build/test-screenshots
- name: Publish coverage report
uses: codecov/codecov-action@v3
env:
OS: Windows
with:
directory: build/reports/
env_vars: OS
- name: Jpackage
run: ./gradlew --info --stacktrace jpackage
- name: Upload installer (exe)
uses: actions/upload-artifact@v3
with:
name: boundingboxeditor-installer-windows-exe
path: build/jpackage/*.exe
- name: Upload image
uses: actions/upload-artifact@v3
with:
name: boundingboxeditor-portable-windows
path: build/jpackage/BoundingBoxEditor
- name: Sonarqube analysis
run: ./gradlew sonarqube '-Dsonar.host.url=https://sonarcloud.io' '-Dsonar.login=${{ secrets.SONAR_TOKEN }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Stop Gradle daemons
run: ./gradlew --stop
Build-and-Test-Linux:
runs-on: ubuntu-latest
name: Build and Test (Linux)
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: gradle
- name: Verify Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: java
- name: Build
run: ./gradlew --info --stacktrace build -x test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Test setup
run: |
sudo apt-get install xvfb fluxbox
Xvfb :10 -screen 0 ${TEST_SCREEN_WIDTH}x${TEST_SCREEN_HEIGHT}x24 &
fluxbox -display :10 &
- name: Test
id: test
run: DISPLAY=:10 ./gradlew --stacktrace --info test
- name: Upload failed test screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: failed-test-screenshots-linux
path: build/test-screenshots
- name: Publish coverage report
uses: codecov/codecov-action@v3
env:
OS: Linux
with:
directory: build/reports/
env_vars: OS
- name: Jpackage
run: ./gradlew --info --stacktrace jpackage
- name: Upload installer (deb)
uses: actions/upload-artifact@v3
with:
name: boundingboxeditor-installer-linux-deb
path: build/jpackage/*.deb
- name: Upload installer (rpm)
uses: actions/upload-artifact@v3
with:
name: boundingboxeditor-installer-linux-rpm
path: build/jpackage/*.rpm
- name: Upload image
uses: actions/upload-artifact@v3
with:
name: boundingboxeditor-portable-linux
path: build/jpackage/BoundingBoxEditor
Build-and-Test-macOS:
runs-on: macos-latest
name: Build and Test (macOS)
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: gradle
- name: Verify Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build
run: ./gradlew --info --stacktrace build -x test
- name: Test
id: test
run: ./gradlew --info --stacktrace test
- name: Publish coverage report
uses: codecov/codecov-action@v3
env:
OS: macOS
with:
directory: build/reports/
env_vars: OS
- name: Jpackage
run: ./gradlew --info --stacktrace jpackage
- name: Upload installer (dmg)
uses: actions/upload-artifact@v3
with:
name: boundingboxeditor-installer-macos-dmg
path: build/jpackage/*.dmg
- name: Upload image
uses: actions/upload-artifact@v3
with:
name: boundingboxeditor-portable-macos
path: build/jpackage/BoundingBoxEditor.app
Release:
needs: [Build-and-Test-Windows, Build-and-Test-Linux, Build-and-Test-macOS]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
name: Github Release
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create changelog
id: changelog
run: |
body_text="$(git log --no-merges --pretty=format:"* %H %s" $(git describe --tags --abbrev=0 @^)..@)"
num_lines="$(echo "$body_text" | wc -l)"
if [ "$num_lines" -gt "10" ]
then
body_text="$(echo "$body_text" | sed '10a<details><summary><b>See More</b></summary>\n')"
body_text="$(echo "$body_text" | sed '$a\\n</details>')"
fi
body_text="$(echo "$body_text" | sed '1i## Changes:\n')"
body_text="${body_text//'%'/'%25'}"
body_text="${body_text//$'\n'/'%0A'}"
body_text="${body_text//$'\r'/'%0D'}"
echo "::set-output name=body::$body_text"
- name: Download all build artifacts
uses: actions/download-artifact@v3
- name: Prepare artifacts
run: |
sudo apt-get install rename
mv boundingboxeditor-installer-*/* .
find "$PWD"/* -maxdepth 0 -type f -name "BoundingBoxEditor*" -exec basename {} ";" | rename -f 'y/A-Z/a-z/'
for image_dir in $(find "$PWD"/* -maxdepth 0 -type d -name "boundingboxeditor-portable-*")
do
cd $image_dir
zip -r $image_dir *
done
- name: Release to github
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.changelog.outputs.body }}
files: |
boundingboxeditor*.exe
boundingboxeditor*.deb
boundingboxeditor*.rpm
boundingboxeditor*.dmg
boundingboxeditor-portable-*.zip