Skip to content

2.0.28

2.0.28 #453

Workflow file for this run

name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dorg.gradle.jvmargs=-Xmx4g"
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
artifact: ${{ steps.artifact.outputs.filename }}
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Configure Git
run: |
git config --global init.defaultBranch main
git --version
echo "Git configuration:"
git config --list
- name: Fetch Sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Print Java version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
cache-read-only: false
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Check for webapp directory and package-lock.json
id: check-webapp
run: |
if [ -f "webapp/package-lock.json" ]; then
echo "has-webapp=true" >> $GITHUB_OUTPUT
echo "webapp/package-lock.json exists"
else
echo "has-webapp=false" >> $GITHUB_OUTPUT
echo "webapp/package-lock.json does not exist"
fi
- name: Setup Node.js
if: steps.check-webapp.outputs.has-webapp == 'true'
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: webapp/package-lock.json
- name: Export Properties
id: properties
shell: bash
run: |
echo "Starting properties export..."
PROPERTIES="$(./gradlew :intellij:properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew :intellij:getChangelog --unreleased --no-header --console=plain -q)"
echo "Detected version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "Properties export completed"
- name: Build plugin
run: |
echo "Starting plugin build..."
./gradlew :intellij:buildPlugin
echo "Plugin build completed"
- name: Prepare Plugin Artifact
id: artifact
shell: bash
run: |
echo "Preparing plugin artifact..."
cd ${{ github.workspace }}/intellij/build/distributions
FILENAME=`ls *.zip`
echo "Found artifact: $FILENAME"
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
echo "Artifact preparation completed"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.filename }}
path: intellij/build/distributions/*
retention-days: 30
- name: List uploaded artifacts
run: |
echo "Uploaded artifacts in distributions directory:"
ls -la intellij/build/distributions/
build-windows-installer:
name: Build Windows Installer
runs-on: windows-latest
needs: [ build ]
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dorg.gradle.jvmargs=-Xmx4g"
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Print Java version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Install WiX Toolset
run: |
choco install wixtoolset -y
- name: Ensure App Image Directory Exists
shell: pwsh
run: |
if (-Not (Test-Path "build\\jpackage\\Cognotik")) {
New-Item -ItemType Directory -Force -Path "build\\jpackage\\Cognotik"
}
- name: Update Cognotik Version
shell: pwsh
run: |
$version = "${{ needs.build.outputs.version }}"
Write-Output "Setting Cognotik version to: $version"
$gradlePropertiesPath = "gradle.properties"
$content = Get-Content $gradlePropertiesPath -Raw
$updatedContent = $content -replace "libraryVersion\s*=\s*[0-9.]+", "libraryVersion = $version"
Set-Content -Path $gradlePropertiesPath -Value $updatedContent
Write-Output "Updated gradle.properties with new version"
- name: Build Windows MSI Installer
run: ./gradlew :desktop:package
- name: List MSI artifacts
run: |
echo "MSI artifacts in jpackage directory:"
if (Test-Path "desktop/build/jpackage") {
Get-ChildItem -Path desktop/build/jpackage -Recurse -Filter *.msi | ForEach-Object { $_.FullName }
} else {
Write-Output "desktop/build/jpackage directory not found."
}
- name: Upload MSI artifact
uses: actions/upload-artifact@v4
with:
name: skyenet-windows-installer
path: desktop/build/jpackage/*.msi
retention-days: 30
build-linux-installer:
name: Build Linux Installer
runs-on: ubuntu-latest
needs: [ build ]
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dorg.gradle.jvmargs=-Xmx4g"
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Configure Git
run: |
git config --global init.defaultBranch main
git --version
echo "Git configuration:"
git config --list
- name: Fetch Sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Print Java version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Build Linux DEB Installer
run: ./gradlew :desktop:package
- name: List DEB artifacts
run: |
echo "DEB artifacts in jpackage directory:"
ls -la desktop/build/jpackage/*.deb || echo "No DEB files found"
- name: Upload DEB artifact
uses: actions/upload-artifact@v4
with:
name: skyenet-linux-installer
path: desktop/build/jpackage/*.deb
retention-days: 30
build-mac-installer:
name: Build Mac Installer
runs-on: macos-latest
needs: [ build ]
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dorg.gradle.jvmargs=-Xmx4g"
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Print Java version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Build Mac DMG Installer
run: ./gradlew :desktop:package
- name: List DMG artifacts
run: |
echo "DMG artifacts in jpackage directory:"
ls -la desktop/build/jpackage/*.dmg || echo "No DMG files found"
- name: Upload DMG artifact
uses: actions/upload-artifact@v4
with:
name: skyenet-mac-installer
path: desktop/build/jpackage/*.dmg
retention-days: 30
test:
name: Test
needs: [ build ]
runs-on: ubuntu-latest
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dorg.gradle.jvmargs=-Xmx4g"
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Configure Git
run: |
git config --global init.defaultBranch main
git --version
echo "Git configuration:"
git config --list
- name: Fetch Sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Print Java version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Print Gradle version
run: ./gradlew --version
- name: Run Tests
run: |
echo "Starting test execution..."
./gradlew test check
echo "Test execution completed"
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: tests-result
path: intellij/build/reports/tests
retention-days: 7
verify:
name: Verify plugin
needs: [ build ]
runs-on: ubuntu-latest
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dorg.gradle.jvmargs=-Xmx4g"
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Configure Git
run: |
git config --global init.defaultBranch main
git --version
echo "Git configuration:"
git config --list
- name: Fetch Sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Print Java version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Print Gradle version
run: ./gradlew --version
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v4
with:
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('intellij/build/listProductsReleases.txt') }}
restore-keys: |
plugin-verifier-
- name: Run Plugin Verification tasks
run: ./gradlew :intellij:verifyPlugin
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: pluginVerifier-result
path: intellij/build/reports/pluginVerifier
retention-days: 7
releaseDraft:
name: Release draft
if: github.event_name != 'pull_request'
needs: [ build, test, verify, build-windows-installer, build-linux-installer, build-mac-installer ]
runs-on: ubuntu-latest
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.logging.level=info -Dorg.gradle.jvmargs=-Xmx4g"
permissions:
contents: write
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Configure Git
run: |
git config --global init.defaultBranch main
git --version
echo "Git configuration:"
git config --list
- name: Fetch Sources
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
cache: gradle
- name: Print Java version
run: |
java -version
echo "JAVA_HOME=$JAVA_HOME"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-home-cache-cleanup: true
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Print Gradle version
run: ./gradlew --version
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
- name: Create Release Draft
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ needs.build.outputs.version }}" \
--draft \
--title "v${{ needs.build.outputs.version }}" \
--notes "${{ needs.build.outputs.changelog }}"
RELEASE_URL=$(gh release view "v${{ needs.build.outputs.version }}" --json url -q .url)
echo "release_url=$RELEASE_URL" >> $GITHUB_OUTPUT
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact }}
path: ./artifact
- name: Download Windows Installer
uses: actions/download-artifact@v4
with:
name: skyenet-windows-installer
path: ./windows-installer
- name: Download Linux Installer
uses: actions/download-artifact@v4
with:
name: skyenet-linux-installer
path: ./linux-installer
- name: Download Mac Installer
uses: actions/download-artifact@v4
with:
name: skyenet-mac-installer
path: ./mac-installer
- name: Upload Plugin Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Uploading plugin asset..."
gh release upload "v${{ needs.build.outputs.version }}" \
"./artifact/"*.zip
- name: Upload Windows Installer Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Uploading Windows installer asset..."
MSI_FILE=$(find ./windows-installer -name "*.msi" -type f)
if [ -z "$MSI_FILE" ]; then
echo "Error: No MSI file found in windows-installer directory"
ls -la ./windows-installer
exit 1
fi
echo "Found MSI file: $MSI_FILE"
gh release upload "v${{ needs.build.outputs.version }}" \
"$MSI_FILE"
- name: Upload Linux Installer Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Uploading Linux installer asset..."
DEB_FILE=$(find ./linux-installer -name "*.deb" -type f)
if [ -z "$DEB_FILE" ]; then
echo "Error: No DEB file found in linux-installer directory"
ls -la ./linux-installer
exit 1
fi
echo "Found DEB file: $DEB_FILE"
gh release upload "v${{ needs.build.outputs.version }}" \
"$DEB_FILE"
- name: Upload Mac Installer Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Uploading Mac installer asset..."
DMG_FILE=$(find ./mac-installer -name "*.dmg" -type f)
if [ -z "$DMG_FILE" ]; then
echo "Error: No DMG file found in mac-installer directory"
ls -la ./mac-installer
exit 1
fi
echo "Found DMG file: $DMG_FILE"
gh release upload "v${{ needs.build.outputs.version }}" \
"$DMG_FILE"