Skip to content

Commit

Permalink
Generate native-image binaries for google-java-format
Browse files Browse the repository at this point in the history
And include them in release artifacts.

I tested this on my fork of the repo, and have a demo here:
https://github.com/cushon/google-java-format/releases

When downloading the artifacts from the releases page they don't have
the executable bit set, and my Mac blocks them because they aren't
signed. That can be worked around with the following, but isn't ideal:

```
chmod a+rx google-java-format-darwin
sudo xattr -r -d com.apple.quarantine google-java-format-darwin
```

Progress towards #868
  • Loading branch information
cushon committed Feb 16, 2024
1 parent b9b41fa commit 9851a39
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -79,3 +79,31 @@ jobs:
files: |
core/target/google-java-format*
eclipse_plugin/target/google-java-format-eclipse-plugin-*.jar
build-native-image:
name: "Build GraalVM native-image on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
needs: build-maven-jars
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: "Check out repository"
uses: actions/checkout@v4
- name: "Set up GraalVM"
uses: graalvm/setup-graalvm@v1
with:
java-version: "21"
distribution: "graalvm-community"
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: "true"
cache: "maven"
- name: "Native"
run: mvn -Pnative -DskipTests package -pl core -am
- name: "Move outputs"
run: cp core/target/google-java-format google-java-format-${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
- name: "Upload native-image"
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "v${{ github.event.inputs.version }}" "google-java-format-${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}"

0 comments on commit 9851a39

Please sign in to comment.