Skip to content

Commit

Permalink
ci: Attempt to fix build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Jan 31, 2024
1 parent fdde852 commit 2948a3d
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ jobs:

- uses: actions/download-artifact@v4
with:
path: ./
path: ./artifacts
name: build-output

- name: List artifacts
run: find ./artifacts

# For Linux, we build a statically linked native image, to allow for building a 'FROM scratch'
# Docker image, and to avoid libc version issues. Since Jansi is not supported on statically
Expand All @@ -118,7 +121,7 @@ jobs:
# at build time (see https://www.graalvm.org/22.1/reference-manual/native-image/Properties/).
# We also exclude the native Jansi library resources, as these are now no longer needed.
- name: Create native fcli
run: native-image ${{ env.native_image_opts }} --static --libc=musl -Djansi.disable=true --initialize-at-build-time=com.fortify.cli.app.FortifyCLI -H:ExcludeResources="org/fusesource/jansi/internal/native/.*" -jar ./artifact/release-assets/fcli.jar fcli
run: native-image ${{ env.native_image_opts }} --static --libc=musl -Djansi.disable=true --initialize-at-build-time=com.fortify.cli.app.FortifyCLI -H:ExcludeResources="org/fusesource/jansi/internal/native/.*" -jar ./artifacts/release-assets/fcli.jar fcli

- name: Compress native fcli
uses: svenstaro/upx-action@v2
Expand All @@ -132,11 +135,11 @@ jobs:
run: ./fcli --version | tee /dev/stderr | grep -E '[0-9]+\.[0-9]+\.[0-9]+' >/dev/null || (echo "fcli --version doesn't output proper version number"; exit 1)

- name: Package native fcli
run: tar -zcvf artifact/release-assets/fcli-linux.tgz fcli -C ./artifact fcli_completion
run: tar -zcvf artifacts/release-assets/fcli-linux.tgz fcli -C ./artifact fcli_completion

- uses: actions/upload-artifact@v4
with:
path: ./artifact/**/fcli-linux.tgz
path: ./artifacts/**/fcli-linux.tgz
name: fcli-linux

native_mac:
Expand All @@ -156,14 +159,14 @@ jobs:

- uses: actions/download-artifact@v4
with:
path: ./
path: ./artifacts
name: build-output

# For MacOS, we build a dynamically linked image. Jansi by default provides a resource-config.json
# file to include native libraries for all platforms; we override this to include only the MacOS
# libraries
- name: Create native fcli
run: native-image ${{ env.native_image_opts }} -march=compatibility -H:ExcludeResources="org/fusesource/jansi/internal/native/Windows/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/Linux/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/FreeBSD/.*" -jar ./artifact/release-assets/fcli.jar fcli
run: native-image ${{ env.native_image_opts }} -march=compatibility -H:ExcludeResources="org/fusesource/jansi/internal/native/Windows/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/Linux/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/FreeBSD/.*" -jar ./artifacts/release-assets/fcli.jar fcli

- name: Compress native fcli
uses: svenstaro/upx-action@v2
Expand All @@ -174,11 +177,11 @@ jobs:
run: ./fcli --help && ./fcli get --help

- name: Package native fcli
run: tar -zcvf ./artifact/release-assets/fcli-mac.tgz fcli -C ./artifact fcli_completion
run: tar -zcvf ./artifacts/release-assets/fcli-mac.tgz fcli -C ./artifact fcli_completion

- uses: actions/upload-artifact@v4
with:
path: ./artifact/**/fcli-mac.tgz
path: ./artifacts/**/fcli-mac.tgz
name: fcli-mac

native_win:
Expand All @@ -195,7 +198,7 @@ jobs:

- uses: actions/download-artifact@v4
with:
path: ./
path: ./artifacts
name: build-output

# For Windows, we build a dynamically linked image. Jansi by default provides a resource-config.json
Expand All @@ -204,7 +207,7 @@ jobs:
- name: Create native fcli
run: >-
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" &&
${{ env.JAVA_HOME }}\bin\native-image.cmd ${{ env.native_image_opts }} -H:ExcludeResources="org/fusesource/jansi/internal/native/Mac/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/Linux/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/FreeBSD/.*" -jar .\artifact\release-assets\fcli.jar fcli
${{ env.JAVA_HOME }}\bin\native-image.cmd ${{ env.native_image_opts }} -H:ExcludeResources="org/fusesource/jansi/internal/native/Mac/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/Linux/.*" -H:ExcludeResources="org/fusesource/jansi/internal/native/FreeBSD/.*" -jar .\artifacts\release-assets\fcli.jar fcli
shell: cmd

# We don't compress the Windows binary for now as this is incompatible with current Graal version.
Expand All @@ -220,11 +223,11 @@ jobs:
.\fcli.exe get --help
- name: Package native fcli
run: 7z a artifact\release-assets\fcli-windows.zip fcli*.exe
run: 7z a artifacts\release-assets\fcli-windows.zip fcli*.exe

- uses: actions/upload-artifact@v4
with:
path: ./artifact/**/fcli-windows.zip
path: ./artifacts/**/fcli-windows.zip
name: fcli-windows

release:
Expand Down

0 comments on commit 2948a3d

Please sign in to comment.