Skip to content

Commit

Permalink
Merge pull request #5 from acodili-jg/1.20.1/wip-extract-action-from-…
Browse files Browse the repository at this point in the history
…workflow

Extract action from workflow
  • Loading branch information
acodili-jg authored Jul 26, 2023
2 parents e0b4556 + eb7ba21 commit 6e13a63
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 25 deletions.
32 changes: 32 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build
description: Builds and captures the compiled jar

inputs:
capture-artifacts:
description: Should artifacts be captured
required: false
default: true

runs:
using: composite
steps:
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Make Gradle Wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
shell: bash
- name: Build
run: ./gradlew build
shell: bash
- name: Capture build artifacts
if: ${{ inputs.capture-artifacts }}
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
25 changes: 0 additions & 25 deletions .github/workflows/build.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/pull-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Build on pull
on: pull_request

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and capture artifacts
uses: ./.github/actions/build
11 changes: 11 additions & 0 deletions .github/workflows/push-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Build on push
on: push

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and capture artifacts
uses: ./.github/actions/build

0 comments on commit 6e13a63

Please sign in to comment.