Skip to content

Feature: Configure CI/CD #10

Feature: Configure CI/CD

Feature: Configure CI/CD #10

Workflow file for this run

name: Java Maven Build & Publish Artifact
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
publish:
runs-on: ubuntu-latest
needs: build_test
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Verify with Maven
run: mvn --batch-mode --update-snapshots verify
- name: Create staging directory
run: mkdir staging
- name: Copy JAR to staging
run: cp target/*.jar staging
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: Package
path: staging