Skip to content

Commit

Permalink
Add github action for building and publishing artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedol committed Dec 20, 2024
1 parent cb3f5b8 commit 9af5b5d
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build

on:
# Only run on push to main branch
push:
branches:
- main
# Always run on PRs
pull_request:

jobs:
build:
name: Build and Test
runs-on: 'macos-latest'
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4

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

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

- name: Build with Gradle
run: ./gradlew build

publish:
if: github.repository == 'sproctor/compose-data-table' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: [build]
runs-on: macos-latest
timeout-minutes: 60

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

- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4

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

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

- name: Publish release
run: ./gradlew publish --no-configuration-cache
if: success()
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}

0 comments on commit 9af5b5d

Please sign in to comment.