Skip to content
This repository has been archived by the owner on Jul 13, 2024. It is now read-only.

ci/cd: metadata corrections #8

ci/cd: metadata corrections

ci/cd: metadata corrections #8

Workflow file for this run

on:
push:
tags:
- "v*"
jobs:
build:
name: Build pteroctl for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Setup GraalVM on Ubuntu
if: matrix.os == 'ubuntu-latest'
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-musl: true
- name: Setup GraalVM on Windows
if: matrix.os == 'windows-latest'
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build with GraalVM
run: |
./gradlew nativeCompile
- 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') }}
- 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/pterocli-ubuntu-latest/pterocli
asset_name: pterocli_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/pterocli-windows-latest/pterocli.exe
asset_name: pterocli_win64.exe
asset_content_type: application/octet-stream