Skip to content

Commit

Permalink
Update Build Action and Injection
Browse files Browse the repository at this point in the history
  • Loading branch information
nailujx86 committed Jun 21, 2024
1 parent d0275a9 commit 9fb5aa5
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 16 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,36 @@ on:
pull_request:

jobs:
buildPlugin:
uses: ./.github/workflows/buildPlugin.yml
repackageAndUploadArtifact:
name: Upload build artifact
build:
name: Build and upload plugin artifact
runs-on: ubuntu-24.04
needs:
- buildPlugin
steps:
- name: Download plugin artifact
uses: actions/download-artifact@v4
- name: Check out repository
uses: actions/checkout@v4
with:
name: ${{ needs.buildPlugin.outputs.artifactName }}
path: ${{ github.workspace }}/plugin
- name: Delete plugin artifact
uses: geekyeggo/delete-artifact@v5
lfs: true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
name: ${{ needs.buildPlugin.outputs.artifactName }}
java-version: 17
distribution: adopt-hotspot
- name: Run Gradle Check # also ensures gradle is downloaded
run: |
chmod +x gradlew
./gradlew check
- name: Set Variables
id: environment
shell: bash
run: echo "version=$(./gradlew printVersion --console=plain -q)" >> $GITHUB_OUTPUT
- name: Build plugin
run: ./gradlew buildPlugin
- name: Unpack unsigned plugin for repackaging
shell: bash
run: |
cd ${{ github.workspace }}/plugin
cd ${{ github.workspace }}/build/distributions
unzip *.zip -d pluginfiles
- name: Upload built plugin
uses: actions/upload-artifact@v4
with:
name: autoconfig-plugin-${{ needs.buildPlugin.outputs.version }}
path: plugin/pluginfiles/*/*
name: autoconfig-plugin-${{ steps.environment.outputs.version }}
path: build/distributions/pluginfiles/*/*
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
release:
types:
- published

jobs:
build:
name: Build, sign and publish plugin
runs-on: ubuntu-24.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
lfs: true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt-hotspot
- name: Run Gradle Check # also ensures gradle is downloaded
run: |
chmod +x gradlew
./gradlew check
- name: Set Variables
id: environment
shell: bash
run: |
echo "version=$(./gradlew printVersion --console=plain -q)" >> $GITHUB_OUTPUT
- name: Set release flag
id: release
shell: bash
run: echo "preRelease=${{ github.event.release.prerelease}}" >> $GITHUB_OUTPUT
- name: Build plugin
run: ./gradlew buildPlugin signPlugin publishPlugin -PpreRelease=${{ steps.release.outputs.preRelease }}
env:
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ signPlugin {
password = System.getenv("PRIVATE_KEY_PASSWORD")
}

publishPlugin {
token = System.getenv("PUBLISH_TOKEN")
hidden = getProperty("hidden")
channels = getProperty("preRelease") ? ["autoconfig-beta"] : ["default", "autoconfig-beta"]
}

repositories {
mavenCentral()
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Autoconfig Plugin Properties
pluginVersion = 0.0.2
preRelease = false
hidden = true
pluginGroup = de.gebit.plugins.autoconfig

# IntelliJ Plugin Build Support
Expand Down

0 comments on commit 9fb5aa5

Please sign in to comment.