Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mettok committed Oct 29, 2024
1 parent 0aa7b10 commit 9ae765a
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
name: Build and publish
name: Build and Upload JAR

on:
push:
branches:
- main
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 21
distribution: temurin
cache: gradle
java-version: '21'
distribution: 'temurin'

- name: Verify Gradle wrapper checksum
uses: gradle/wrapper-validation-action@v3
- name: Set up Gradle
uses: gradle/gradle-build-action@v2

- name: Build and publish with Gradle
run: ./gradlew build publish
- name: Build JAR
run: ./gradlew clean build

- name: Make Executable JAR
run: ./gradlew jar

- name: Upload JAR as artifact
uses: actions/upload-artifact@v3
with:
name: kotlin-executable
path: build/libs/*.jar
retention-days: 30 # Retain for 30 days (adjust as needed)
env:
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9ae765a

Please sign in to comment.