Skip to content

Commit

Permalink
Windows build
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Jan 14, 2024
1 parent e43bedf commit a99fe60
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,46 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: appthreat/atom
jobs:
release-win:
if: github.repository_owner == 'appthreat'
concurrency: release-win
runs-on: windows-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm-community'
java-version: '21'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
cache: 'sbt'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- run: |
Invoke-WebRequest -Uri https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-win64.zip -UseBasicParsing -OutFile upx-4.2.2-win64.zip
Expand-Archive -Path upx-4.2.2-win64.zip -DestinationPath . -Force
sbt stage astGenDlTask assembly createDistribution
sbt "GraalVMNativeImage / packageBin"
upx-4.2.2-win64\upx.exe -9 --lzma target\graalvm-native-image\atom.exe
target\graalvm-native-image\atom.exe --help
(Get-FileHash -Algorithm SHA512 .\target\graalvm-native-image\atom.exe).hash | Out-File -FilePath .\target\graalvm-native-image\atom.exe.sha512
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
target\graalvm-native-image\atom.exe
target\graalvm-native-image\atom.exe.sha512
release:
if: github.repository_owner == 'appthreat'
concurrency: release
Expand All @@ -19,7 +59,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- name: Set up JDK
uses: graalvm/setup-graalvm@v1
with:
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ curl -LO https://github.com/AppThreat/atom/releases/download/v2.0.5/atom.exe
.\atom.exe --help
```

Windows native images are currently built and uploaded to releases manually. This is due to the extra steps involved with the use of x64 Native Tools Command Prompt.

NOTE: cdxgen is not bundled into the native image so needs to be installed separately.

## CLI Usage
Expand Down

0 comments on commit a99fe60

Please sign in to comment.