Skip to content

Commit

Permalink
Support new versions with no limit
Browse files Browse the repository at this point in the history
  • Loading branch information
popematt committed Sep 27, 2024
1 parent 068c3c4 commit 6ac9d97
Show file tree
Hide file tree
Showing 41 changed files with 143 additions and 1,134 deletions.
59 changes: 32 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:

# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
setup:
name: Gradle Wrapper
runs-on: ubuntu-latest
steps:
Expand All @@ -28,22 +28,36 @@ jobs:
- 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: gradleValidation
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
product: [ "IC-2023.1", "IC-2023.2", "IC-2023.3", "IC-2024.1", "IC-2024.2" ]
max-parallel: 5
env:
PRODUCT_NAME: ${{ matrix.product }}
outputs:
name: ${{ steps.properties.outputs.name }}
version: ${{ steps.properties.outputs.version }}
artifact: ${{ steps.properties.outputs.artifact }}
product: ${{ fromJSON(needs.setup.outputs.products) }}
steps:

# Check out current repository
Expand All @@ -70,30 +84,21 @@ jobs:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}

# 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 ' ')"
ARTIFACT="${NAME}-${VERSION}.zip"
echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=artifact::$ARTIFACT"
# Build artifact using buildPlugin Gradle task
- name: Build Plugin
run: ./gradlew buildPlugin

# Run intellij:verifyPlugin task.
- name: Verify Plugin
run: ./gradlew verifyPlugin
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
if: github.repository == 'amazon-ion/ion-intellij-plugin'
env:
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_TOKEN }}
PUBLISH_CHANNEL: beta
Expand All @@ -104,5 +109,5 @@ jobs:
if: github.repository == 'amazon-ion/ion-intellij-plugin'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.product }}-plugin-artifact
path: ./build/distributions/${{ needs.build.outputs.artifact }}
name: plugin-artifact
path: ./build/distributions/
57 changes: 26 additions & 31 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:

# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
setup:
name: Gradle Wrapper
runs-on: ubuntu-latest
steps:
Expand All @@ -27,21 +27,36 @@ jobs:
- 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: gradleValidation
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
product: [ "IC-2023.1", "IC-2023.2", "IC-2023.3", "IC-2024.1", "IC-2024.2" ]
max-parallel: 5
env:
PRODUCT_NAME: ${{ matrix.product }}
outputs:
name: ${{ steps.properties.outputs.name }}
version: ${{ steps.properties.outputs.version }}
artifact: ${{ steps.properties.outputs.artifact }}
product: ${{ fromJSON(needs.setup.outputs.products) }}
steps:

# Check out current repository
Expand All @@ -68,19 +83,6 @@ jobs:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}

# 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 ' ')"
ARTIFACT="${NAME}-${VERSION}.zip"
echo "::set-output name=version::$VERSION"
echo "::set-output name=name::$NAME"
echo "::set-output name=artifact::$ARTIFACT"
# Build artifact using build Gradle task
- name: Build
run: ./gradlew build
Expand All @@ -91,11 +93,4 @@ jobs:

# Run intellij:verifyPlugin task.
- name: Verify Plugin
run: ./gradlew verifyPlugin

# Upload plugin artifact to make it available in the next jobs
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.product }}-plugin-artifact
path: ./build/distributions/${{ needs.build.outputs.artifact }}
run: ./gradlew verifyPlugin -PverifyPlugin="${{ matrix.product }}"
37 changes: 0 additions & 37 deletions .github/workflows/release-eap.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ env:

jobs:
release:
strategy:
matrix:
product: [ "IC-2023.1", "IC-2023.2", "IC-2023.3", "IC-2024.1", "IC-2024.2" ]
max-parallel: 1
env:
PRODUCT_NAME: ${{ matrix.product }}
runs-on: ubuntu-latest
steps:
# Check out current repository
Expand All @@ -48,7 +42,6 @@ jobs:

- name: Publish Stable Plugin
env:
PRODUCT_NAME: ${{ matrix.product }}
PUBLISH_TOKEN: ${{ secrets.JETBRAINS_TOKEN }}
PUBLISH_CHANNEL: release
run: ./gradlew --stacktrace publishPlugin
Loading

0 comments on commit 6ac9d97

Please sign in to comment.