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 ff569b1
Show file tree
Hide file tree
Showing 41 changed files with 158 additions and 1,189 deletions.
98 changes: 43 additions & 55 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,10 @@ on:
- master
jobs:

# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
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

# Build and test plugin and provide artifact.
build:
name: Build
needs: gradleValidation
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 }}
steps:

# Check out current repository
Expand All @@ -56,44 +30,58 @@ jobs:
distribution: 'corretto'
java-version: '17'

# Cache Gradle dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2
- uses: gradle/actions/setup-gradle@v4
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') }}

# 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"
cache-write-only: true

# Build artifact using buildPlugin Gradle task
- name: Build Plugin
run: ./gradlew buildPlugin

- name: Get Product Versions
id: get-products
run: |
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 }}

verify:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
product: ${{ fromJSON(needs.build.outputs.products) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

# Run intellij:verifyPlugin task.
- name: Verify Plugin
run: ./gradlew verifyPlugin
run: ./gradlew verifyPlugin -PverifyPlugin="${{ matrix.product }}"

publish-beta:
needs: verify
runs-on: ubuntu-latest
if: github.repository == 'amazon-ion/ion-intellij-plugin'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
# 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 +92,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/
88 changes: 30 additions & 58 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,10 @@ on:
- '*.md'
jobs:

# Run Gradle Wrapper Validation Action to verify the wrapper's checksum
gradleValidation:
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

# Build and test plugin and provide artifact.
build:
name: Build
needs: gradleValidation
runs-on: ubuntu-latest
strategy:
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 }}
steps:

# Check out current repository
Expand All @@ -54,32 +29,9 @@ jobs:
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
- uses: gradle/actions/setup-gradle@v4
with:
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"
cache-write-only: true

# Build artifact using build Gradle task
- name: Build
Expand All @@ -89,13 +41,33 @@ jobs:
- name: Build Plugin
run: ./gradlew buildPlugin

# Run intellij:verifyPlugin task.
- name: Verify Plugin
run: ./gradlew verifyPlugin
- name: Get Product Versions
id: get-products
run: |
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 }}

# Upload plugin artifact to make it available in the next jobs
- name: Upload artifact
uses: actions/upload-artifact@v4
verify:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
product: ${{ fromJSON(needs.build.outputs.products) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- uses: gradle/actions/setup-gradle@v4
with:
name: ${{ matrix.product }}-plugin-artifact
path: ./build/distributions/${{ needs.build.outputs.artifact }}
cache-read-only: true

# Run intellij:verifyPlugin task.
- name: Verify Plugin
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 ff569b1

Please sign in to comment.