Skip to content

Commit

Permalink
ci: configure github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Nov 7, 2024
1 parent 0dde537 commit bcb9a83
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build

permissions:
contents: read

on:
push:
branches:
- master
pull_request:
branches:
- master

defaults:
run:
shell: bash

jobs:
build:
name: Build
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Cache Konan
id: cache-kotlin-konan
uses: actions/cache@v3
with:
path: |
~/.konan/**/*
key: kotlin-konan

- name: Build project
run: ./gradlew build --build-cache --parallel --no-daemon
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

permissions:
contents: read

on:
push:
tags:
- v*
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
publish:
name: Build and Publish
runs-on: macos-latest
if: ${{ !contains(github.event.head_commit.message, '#skip') }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Cache Konan
id: cache-kotlin-konan
uses: actions/cache@v3
with:
path: |
~/.konan/**/*
key: kotlin-konan

- name: Publish to Maven Central
run: ./gradlew publishAllPublicationsToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

0 comments on commit bcb9a83

Please sign in to comment.