Skip to content

Support new versions with no limit #16

Support new versions with no limit

Support new versions with no limit #16

Workflow file for this run

# GitHub Action Workflow for building a new commit to the primary repo branch and publishing a new release to beta.
#
# Workflow is triggered on pushes into master.
#
# Additional Docs:
# - GitHub Actions: https://help.github.com/en/actions
name: build-master
on:
push:
paths-ignore:
- '*.md'
branches:
- master
jobs:
# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
setup:
name: Gradle Wrapper
runs-on: ubuntu-latest
steps:
# Check out current repository
- name: Fetch sources
uses: actions/checkout@v2
# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
# First, invoke gradlew with no tasks to ensure that gradle is downloaded so that we don't get things
# like this in the product releases output.
# "Downloading https://services.gradle.org/distributions/gradle-8.10.1-bin.zip"
# Then run the actual task we want.
- name: Get Product Versions
id: get-products
run: |
./gradlew
PRODUCTS="$(./gradlew printProductsReleases -q | jq -cnR '[inputs | select(length > 0)]')"
echo "products=$PRODUCTS"
echo "products=$PRODUCTS" >> "$GITHUB_OUTPUT"
outputs:
products: ${{ steps.get-products.outputs.products }}
# Build and test plugin and provide artifact.
build:
name: Build
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
product: ${{ fromJSON(needs.setup.outputs.products) }}
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v2
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
# Cache Gradle dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}
# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
# Build artifact using buildPlugin Gradle task
- name: Build Plugin
run: ./gradlew buildPlugin
# Run intellij:verifyPlugin task.
- name: Verify Plugin
run: ./gradlew verifyPlugin -PverifyProduct="${{ matrix.product }}"
publish-beta:
needs: build
runs-on: ubuntu-latest
if: github.repository == 'amazon-ion/ion-intellij-plugin'
steps:
# Publish plugin to beta channel
- name: Publish Beta Plugin
env:
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_TOKEN }}
PUBLISH_CHANNEL: beta
run: ./gradlew --stacktrace publishPlugin
# Upload plugin artifact to make it available in the next jobs
- name: Upload artifact
if: github.repository == 'amazon-ion/ion-intellij-plugin'
uses: actions/upload-artifact@v4
with:
name: plugin-artifact
path: ./build/distributions/