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
name: CI (Compile, Build, and Publish IntelliJ Plugin) | |
on: | |
push: | |
branches: | |
- "7.2.0" | |
pull_request: | |
branches: | |
- "7.2.0" | |
release: | |
types: | |
- created | |
jobs: | |
test: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '11' | |
- name: Grant execute permissions to Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: Verify Gradle Version (Using Project's Wrapper) | |
run: ./gradlew --version | |
- name: Cleanup Before Build | |
run: rm -rf build/distributions/* | |
- name: Build Plugin | |
run: ./gradlew clean buildPlugin --refresh-dependencies --stacktrace --info | |
package: | |
name: Package, Upload Plugin | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '11' | |
- name: Grant execute permissions to Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: Cleanup Before Build | |
run: rm -rf build/distributions/* | |
- name: Build Plugin | |
run: ./gradlew clean buildPlugin --refresh-dependencies --stacktrace --info | |
- name: Ensure output directory exists | |
run: mkdir -p build/distributions | |
- name: Extract Plugin Zip Before Upload | |
run: unzip -d build/distributions/extracted build/distributions/org.jboss.tools.mta-7.2.0.zip | |
- name: Upload Plugin Artifact (As Folder) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: org.jboss.tools.mta-7.2.0 | |
path: build/distributions/extracted | |
if-no-files-found: error | |
publish: | |
name: Publish to JetBrains Marketplace | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.event_name == 'release' | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '11' | |
- name: Grant execute permissions to Gradle wrapper | |
run: chmod +x ./gradlew | |
- name: Build Plugin | |
run: ./gradlew clean buildPlugin --stacktrace --info | |
- name: Ensure Plugin Artifact Exists | |
run: ls -lah build/distributions/ | |
- name: Publish to JetBrains Marketplace (Only for migtools) | |
run: | | |
if [ "${{ github.repository_owner }}" = "migtools" ]; then | |
echo "Publishing to JetBrains Marketplace..." | |
./gradlew publishPlugin -PintellijPublishToken=${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }} | |
else | |
echo "Skipping JetBrains Marketplace publishing since this is a fork." | |
fi | |