Skip to content

Bump actions/checkout from 3 to 4 #16

Bump actions/checkout from 3 to 4

Bump actions/checkout from 3 to 4 #16

Workflow file for this run

name: Build
on: [ pull_request, push, workflow_dispatch ]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: 21
cache: gradle
distribution: temurin
- name: Build
run: ./gradlew build
- name: Publish Test Report
if: success() || failure() # run this step even if previous step failed
uses: dorny/test-reporter@v1
with:
name: Kotest report
path: ./**/build/test-results/test/*.xml
reporter: java-junit
- name: Publish Coverage Report
uses: codecov/codecov-action@v3
if: github.repository == 'coditory/klog' && github.ref == 'refs/heads/main'
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
override_commit: ${{ github.event.workflow_run.head_sha }}
override_branch: ${{ github.event.workflow_run.head_branch }}
override_build: ${{ github.event.workflow_run.id }}
files: 'build/reports/kover/report.xml'
- name: Publish Snapshot
run: ./gradlew publishJvmPublicationToSnapshotsRepository
if: github.repository == 'coditory/klog' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
- name: Publish Release
id: publish-release
run: ./gradlew publishJvmPublicationToReleasesRepository
if: github.repository == 'coditory/klog' && startsWith(github.ref, 'refs/tags/v') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
- name: Generate Release Notes
id: generate-release-notes
if: steps.publish-release.conclusion == 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
declare -r NOTES="$(gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/releases/generate-notes \
-f target_commitish='main' \
| jq -r '.body')"
declare -r ESCAPED="${NOTES//$'\n'/'%0A'}"
echo "notes=$ESCAPED" >> $GITHUB_OUTPUT
- name: Create github release (main only)
if: steps.generate-release-notes.conclusion == 'success'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
body: ${{ steps.notes.outputs.notes }}
tag: v${{ steps.versions.outputs.next_version }}
token: ${{ secrets.GITHUB_TOKEN }}