diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f80465..04ab128 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,43 +1,24 @@ -name: CI +name: Build on: push: branches: [ main, ci-cd-improvements ] pull_request: - jobs: build: 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: Set Variables - id: environment - shell: bash - run: | - ./gradlew printVersion --console=plain -q - echo "version=$(./gradlew printVersion --console=plain -q)" >> $GITHUB_OUTPUT - - name: Build plugin - run: | - chmod +x gradlew - ./gradlew check buildPlugin + - name: Build Plugin + id: build + uses: ./.github/workflows/buildPlugin.yml - name: Unpack unsigned plugin for repackaging shell: bash run: | cd ${{ github.workspace }}/build/distributions unzip *.zip -d pluginfiles - - name: Upload built plugin uses: actions/upload-artifact@v4 with: - name: autoconfig-plugin-${{ steps.environment.outputs.version }} - path: build/distributions/pluginfiles/*/* - + name: autoconfig-plugin-${{ steps.build.outputs.version }} + path: build/distributions/pluginfiles/*/* \ No newline at end of file diff --git a/.github/workflows/buildPlugin.yml b/.github/workflows/buildPlugin.yml new file mode 100644 index 0000000..5e48671 --- /dev/null +++ b/.github/workflows/buildPlugin.yml @@ -0,0 +1,39 @@ +name: CI + +on: + workflow_call: + outputs: + version: + value: ${{ jobs.buildPlugin.outputs.version }} + + +jobs: + buildPlugin: + runs-on: ubuntu-24.04 + outputs: + version: ${{ steps.environment.outputs.version }} + 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: Build plugin + run: ./gradlew buildPlugin + - name: Unpack unsigned plugin for repackaging + shell: bash + run: | + cd ${{ github.workspace }}/build/distributions + unzip *.zip -d pluginfiles \ No newline at end of file