-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-14584 Merge infinispan-quarkus into main Infinispan repository
Add GH action to build native CLI for different platforms on each PR
- Loading branch information
1 parent
b79b631
commit 3309fa6
Showing
84 changed files
with
5,765 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-2022] | ||
include: | ||
- os: ubuntu-latest | ||
asset_name: linux-amd64 | ||
gu_binary: gu | ||
- os: macos-latest | ||
asset_name: darwin-amd64 | ||
gu_binary: gu | ||
- os: windows-2022 | ||
asset_name: windows-amd64 | ||
gu_binary: gu.cmd | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- if: ${{ matrix.os == 'windows-2022' }} | ||
name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v1.0.2 | ||
|
||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.3.0' | ||
java-version: '17' | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Cache local Maven repository | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- if: ${{ matrix.os == 'windows-2022' }} | ||
name: Build native executable | ||
run: | | ||
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 | ||
mvn.cmd -V install -s maven-settings.xml -Pdistribution -Pnative -Pwindows -am -pl quarkus/cli | ||
shell: cmd | ||
|
||
- if: ${{ matrix.os != 'windows-2022' }} | ||
name: Build native executable | ||
run: mvn -V install -s maven-settings.xml -Pdistribution -Pnative -am -pl quarkus/cli |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Release Native Binaries | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
|
||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v2 | ||
|
||
- id: release | ||
name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{github.ref_name}} | ||
release_name: ${{github.ref_name}} | ||
|
||
build: | ||
needs: release | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-2022] | ||
include: | ||
- os: ubuntu-latest | ||
asset_name: linux-amd64 | ||
gu_binary: gu | ||
- os: macos-latest | ||
asset_name: darwin-amd64 | ||
gu_binary: gu | ||
- os: windows-2022 | ||
asset_name: windows-amd64 | ||
gu_binary: gu.cmd | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- if: ${{ matrix.os == 'windows-2022' }} | ||
name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v1.0.2 | ||
|
||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
version: '22.3.0' | ||
java-version: '17' | ||
components: 'native-image' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout Release Tag | ||
uses: actions/checkout@v2 | ||
|
||
- if: ${{ matrix.os == 'windows-2022' }} | ||
name: Build native executable | ||
run: | | ||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 | ||
mvnw.cmd package -s maven-settings.xml -Pdistribution -Pwindows -Pnative -am -pl cli | ||
shell: cmd | ||
|
||
- if: ${{ matrix.os != 'windows-2022' }} | ||
name: Build native executable | ||
run: ./mvnw package -s maven-settings.xml -Pdistribution -Pnative -am -pl cli | ||
|
||
- name: Upload CLI native executable | ||
id: upload-cli-native-executable | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./cli/target/infinispan-cli-${{github.ref_name}}.zip | ||
asset_name: infinispan-cli-${{github.ref_name}}-${{ matrix.asset_name }}.zip | ||
asset_content_type: application/zip |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# How to build native | ||
|
||
1. Download and extract the Java 17 version of GraalVM (>= 22.3) from | ||
https://github.com/graalvm/graalvm-ce-builds/releases | ||
for your distribution. | ||
2. Install `native-image` in the `bin` directory of the extracted graal | ||
runtime | ||
* `gu install native-image` | ||
3. Set the `GRAALVM_HOME` environment variable to the extracted | ||
graal runtime | ||
4. Build the project | ||
* `mvn clean install -P native -am -pl quarkus` |
Oops, something went wrong.