Skip to content

build: on release, build native library/binary and attach to publishe… #1791

build: on release, build native library/binary and attach to publishe…

build: on release, build native library/binary and attach to publishe… #1791

Workflow file for this run

# GitHub Actions Workflow created for testing and preparing the plugin release in following steps:
# - validate Gradle Wrapper,
# - run 'test' and 'verifyPlugin' tasks,
# - run Qodana inspections,
# - run 'buildPlugin' task and prepare artifact for the further tests,
# - run 'runPluginVerifier' task,
# - create a draft release.
name: Build
on:
workflow_dispatch:
push:
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4
# Setup Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 21
# install radicle
- name: Install Radicle
env:
RAD_HOME: ${{ github.workspace }}/.radicle
run: |
curl -sSf https://radicle.xyz/install | sh
echo "${RAD_HOME}/bin" >> $GITHUB_PATH
echo "RAD_HOME=${{ github.workspace }}/.radicle" >> $GITHUB_ENV
# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "name=$NAME" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Run tests
- name: Run Tests
run: ./gradlew :check --scan
# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests
buildNativeLib:
name: BuildNativeLib
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: macos-latest
# radicle cannot be compiled on Windows
# - os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Lint
working-directory: ./jrad
run: |
cargo fmt --all --check
cargo clippy --all --tests
- name: Build
working-directory: ./jrad
run: |
cargo build --release