Build 59 #81
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: native-executable | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: mousemaster on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
steps: | |
- uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: 'true' | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Build jar | |
run: mvnw clean package | |
shell: cmd | |
- name: Find JAR file | |
id: find_jar | |
run: | | |
$jarPath = Get-ChildItem -Recurse -Filter "mousemaster-*-jar-with-dependencies.jar" -Path .\target | Select-Object -First 1 | |
echo "::set-output name=jar_path::$jarPath" | |
- name: Extract version from JAR file | |
id: extract_version | |
run: | | |
$jarPath = "${{ steps.find_jar.outputs.jar_path }}" | |
$version = [regex]::match($jarPath, 'mousemaster-(.*?)-jar-with-dependencies\.jar').Groups[1].Value | |
echo "::set-output name=version::$version" | |
- name: Build GraalVM native executable | |
run: mvnw -Pnative -Dagent package | |
shell: cmd | |
- name: Rename GraalVM executable | |
run: ren target\mousemaster.exe mousemaster-without-vcruntime140.exe | |
- name: Embed VCRUNTIME140.dll | |
run: pefrmdllembed\pefrmdllembed.exe -impinj target/mousemaster-without-vcruntime140.exe ./pefrmdllembed/VCRUNTIME140.dll target/mousemaster.exe | |
shell: cmd | |
- name: Get commit message | |
id: get_commit_message | |
run: | | |
$commitMessage = git log -1 --pretty=%B ${{ github.ref_name }} | |
$releaseNotes += "### New features and improvements`n" | |
$releaseNotes += ($commitMessage -split '\r?\n' | Select-Object -Skip 2) -join "`n" | |
$releaseNotes += "`n" | |
$releaseNotes += "### Installation`n" | |
$releaseNotes += "1. Download **mousemaster.exe** (a portable executable).`n" | |
$releaseNotes += "2. Download one of the existing configuration files:`n" | |
$releaseNotes += " - **neo-mousekeys.properties** (***recommended***): a WASD configuration ([see documentation](configuration/neo-mousekeys.md))`n" | |
$releaseNotes += " - **warpd.properties**: an HKJL configuration ([see documentation](configuration/warpd.md))`n" | |
$releaseNotes += " - **mouseable.properties**: another HKJL configuration ([see documentation](configuration/mouseable.md))`n" | |
$releaseNotes += " - **author.properties**: an IJKL configuration designed to control everything with the right hand only. ([see documentation](configuration/author.md))`n" | |
$releaseNotes += "3. Place the executable and the configuration file in the same directory.`n" | |
$releaseNotes += "4. Rename the configuration file to **mousemaster.properties**.`n" | |
$releaseNotes += "5. Run **mousemaster.exe**: make sure to run it as administrator if you want the mousemaster overlay to be displayed on top of everything else.`n" | |
$releaseNotes += "6. Feel free to open a [GitHub Issue](https://github.com/petoncle/mousemaster/issues) or join the [Discord](https://discord.gg/GSB6MaKb2R) if you need help creating your own configuration. If you have ideas for a better configuration that you would like to share, I'd love to hear from you.`n" | |
$releaseNotes += "7. If you enjoy mousemaster, consider making a [donation](https://ko-fi.com/petoncle) or stop by the Discord to show your support!`n" | |
Set-Content -Path ./release-notes.txt -Value $releaseNotes | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release create ${{ github.ref_name }} "target/mousemaster.exe" "configuration/author.properties" "configuration/mouseable.properties" "configuration/neo-mousekeys.properties" "configuration/warpd.properties" --title "v${{ steps.extract_version.outputs.version }}" --notes-file ./release-notes.txt |