Skip to content

Commit

Permalink
First Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
Var7600 committed Mar 22, 2024
1 parent b92a891 commit 143eef8
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Checkstyle
'on':
push:
branches:
- main
pull_request:
branches:
- main
jobs:
checkstyle:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 18
uses: actions/setup-java@v4
with:
java-version: '18'
distribution: temurin
- name: Run Checkstyle
run: mvn validate
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

'on':
workflow_run:
workflows:
- Test
types:
- completed
env:
JAVA_VERSION: '18'
JAVA_DISTRO: 'temurin'

jobs:

release:
runs-on: ubuntu-latest
outputs:
VERSION: ${{ steps.project.outputs.VERSION }}

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

# set up Java
- name: Set up Java 18
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
cache: maven

- name: Package with Maven
run: >-
mvn --batch-mode -Dcheckstyle.skip -DskipTests package

# github release
- name: Release
uses: jreleaser/release-action@v2
with:
arguments: full-release
env:
JRELEASER_PROJECT_VERSION: 0.0
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }}

# Upload Artifact
- name: JReleaser output
if: always()
uses: actions/upload-artifact@v4
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test
'on':
workflow_run:
workflows: ["Checkstyle"]
types:
- completed
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 18
uses: actions/setup-java@v4
with:
java-version: '18'
distribution: 'temurin'
cache: maven
- name: Maven Test
run: xvfb-run mvn -Dcheckstyle.skip test


0 comments on commit 143eef8

Please sign in to comment.