updated CI and CD file #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
# pull_request: | |
push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Test | |
run: mvn test | |
- name: Build with Maven | |
run: | | |
mvn -B -P github package -file pom.xml | |
cat $GITHUB_WORKSPACE/settings.xml | |
# mkdir staging && cp target/*.jar staging | |
- name: Publish to GitHub Packages Apache Maven | |
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml | |
env: | |
GITHUB_USER_REF: ${{ secrets.GH_PACKAGE_REPO_USERNAME }} | |
GITHUB_TOKEN_REF: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }} | |
- name: upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Package | |
path: staging | |