Skip to content

Create a new KSE release #46

Create a new KSE release

Create a new KSE release #46

Workflow file for this run

name: Create a new KSE release
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
jobs:
launcher:
name: Build KSE launcher
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install nim mingw-w64
- name: Build
run: nim -d:mingw --cpu:i386 -d:release --app:gui --opt:size --out:kse-launcher.exe c kse_launcher.nim
working-directory: kse/res
- name: Shrink executable
run: strip kse/res/kse-launcher.exe
- name: Store artifacts for release
uses: actions/upload-artifact@v2
with:
name: kse-launcher
path: kse/res/kse-launcher.exe
windows:
name: Create artifacts on Windows
needs: [launcher]
runs-on: windows-2019
steps:
- name: Disable automatic EOL conversions
run: git config --global core.autocrlf false
- name: Install required software packages
run: choco install reshack
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
- uses: actions/download-artifact@v2
with:
name: kse-launcher
path: kse/res
- name: Build with Gradle
run: .\gradlew.bat test zip innosetup
working-directory: kse
- name: Store artifacts for release
uses: actions/upload-artifact@v2
with:
name: windows-artifacts
path: |
kse/build/launcher/kse.exe
- name: Store artifacts for release
uses: actions/upload-artifact@v2
with:
# use second step with same artifact name in order to avoid sub-folders
name: windows-artifacts
path: |
kse/build/distributions/kse-*.zip
kse/build/distributions/kse-*-setup-no-jre.exe
linux:
name: Create artifacts on Linux
runs-on: ubuntu-20.04
steps:
- name: Disable automatic EOL conversions
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'
- name: Build with Gradle
run: ./gradlew test buildDeb buildRpm
working-directory: kse
- name: Store artifacts for release
uses: actions/upload-artifact@v2
with:
name: linux-artifacts
path: |
kse/build/distributions/kse*.deb
kse/build/distributions/kse*.rpm
windows-with-jre:
name: Create a Windows installer with included JRE
needs: [launcher]
runs-on: windows-2019
steps:
- name: Disable automatic EOL conversions
run: git config --global core.autocrlf false
- name: Install required software packages
run: choco install reshack
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/download-artifact@v2
with:
name: kse-launcher
path: kse/res
- name: Build with Gradle
run: .\gradlew.bat test innosetup
working-directory: kse
- name: Store artifacts for release
uses: actions/upload-artifact@v2
with:
name: windows-with-jre-artifact
path: kse/build/distributions/kse-*-setup.exe
macos:
name: Create artifacts on macOS
runs-on: macos-11
steps:
- name: Preparations
env:
MACOS_CERT: ${{ secrets.MACOS_CERT }}
MACOS_CERT_PWD: ${{ secrets.MACOS_CERT_PWD }}
run: |
echo $MACOS_CERT | base64 --decode > macos_cert.p12
security create-keychain -p buildchain build.chain
security default-keychain -s build.chain
security unlock-keychain -p buildchain build.chain
security set-keychain-settings build.chain
security import macos_cert.p12 -k build.chain -P $MACOS_CERT_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k buildchain build.chain
rm -f macos_cert.p12
# actions/setup-java@v2 removes the directories MacOS and _CodeSignature and the file Info.plist from the JDK, so we cannot use it for the application
wget https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/OpenJDK17U-jdk_x64_mac_hotspot_17.0.9_9.tar.gz
tar zxf OpenJDK17U-jdk_x64_mac_hotspot_17.0.9_9.tar.gz -C $RUNNER_TEMP
echo "JAVA_HOME=$RUNNER_TEMP/jdk-17.0.9+9/Contents/Home" >> $GITHUB_ENV
echo "$RUNNER_TEMP/jdk-17.0.9+9/Contents/Home/bin" >> $GITHUB_PATH
# install tools for DMG creation:
npm install --global create-dmg
brew install graphicsmagick imagemagick
- name: Disable automatic EOL conversions
run: git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v2
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew dmg
working-directory: kse
- name: Store artifacts for release
uses: actions/upload-artifact@v2
with:
name: macos-artifact
path: kse/build/distributions/kse*.dmg
release:
needs: [windows, linux, windows-with-jre]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: windows-artifacts
- uses: actions/download-artifact@v2
with:
name: linux-artifacts
- uses: actions/download-artifact@v2
with:
name: windows-with-jre-artifact
- uses: actions/download-artifact@v2
with:
name: macos-artifact
- name: Create a release
uses: softprops/action-gh-release@v1
#if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
name: "KSE Release ${{ github.ref_name }}"
body: "Release Notes are available here: [Release Notes](https://keystore-explorer.org/releases.html)"
files: |
kse-*.zip
kse-*-setup.exe
kse-*-setup-no-jre.exe
kse*.deb
kse*.rpm
kse*.dmg
token: ${{ secrets.github_token }}
- name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v3
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
update_release_body: true
files: |
kse.exe
kse-*.zip
kse-*-setup.exe
kse-*-setup-no-jre.exe