This repository has been archived by the owner on Jul 13, 2024. It is now read-only.
ci/cd: trying to build graalvm properly #4
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
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Build pteroctl for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-22.04] | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
# - name: Install musl | |
# if: matrix.os == 'ubuntu-latest' | |
# run: sudo apt-get install -y musl | |
- name: Setup GraalVM | |
uses: graalvm/setup-graalvm@v1 | |
with: | |
java-version: '21' | |
components: 'native-image' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-musl: true | |
- name: Collect data with native agent through tests | |
env: | |
PANEL_URL: ${{ secrets.PANEL_URL }} | |
ADMIN_KEY: ${{ secrets.ADMIN_KEY }} | |
CLIENT_KEY: ${{ secrets.CLIENT_KEY }} | |
run: | | |
./gradlew test -Pagent | |
- name: Build with GraalVM | |
run: | | |
./gradlew nativeBuild -PgradleDebug=false | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pteroctl-${{ matrix.os }} | |
path: | | |
build/native/nativeCompile/pterocli | |
build/native/nativeCompile/pterocli.exe | |
release: | |
name: Create pteroctl release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Collect artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts/ | |
- name: Show filesystem | |
run: ls -R | |
- name: Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
# if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
prerelease: ${{ contains(github.ref, 'RC') || contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} | |
- name: Upload Linux binary | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/pteroctl-ubuntu-22.04/pteroctl | |
asset_name: pteroctl_amd64 | |
asset_content_type: application/octet-stream | |
- name: Upload Windows binary | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/pteroctl-windows-latest/pteroctl.exe | |
asset_name: pteroctl_win64.exe | |
asset_content_type: application/octet-stream |