update #113
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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | |
name: Maven CI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
jobs: | |
build: | |
name: Build on java ${{ matrix.java }} | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
java: [ '8' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up java ${{ matrix.java }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java }} | |
check-latest: true | |
distribution: 'temurin' | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
- name: Build with Maven | |
run: | | |
echo "<settings><servers><server><id>github</id><username>OWNER</username><password>$GITHUB_TOKEN</password></server></servers><profiles><profile><id>github</id><properties><altReleaseDeploymentRepository>github::default::https://maven.pkg.github.com/shiyindaxiaojie/eden-architect</altReleaseDeploymentRepository><altSnapshotDeploymentRepository>github::default::https://maven.pkg.github.com/shiyindaxiaojie/eden-architect</altSnapshotDeploymentRepository></properties><repositories><repository><id>github</id><name>GitHub OWNER Apache Maven Packages</name><url>https://maven.pkg.github.com/shiyindaxiaojie/eden-architect</url></repository></repositories></profile></profiles></settings>" > $GITHUB_WORKSPACE/settings.xml | |
chmod +x mvnw | |
./mvnw -ntp clean package -Pgithub,unit-test -e -T 4C -s $GITHUB_WORKSPACE/settings.xml | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Publish to GitHub Packages Apache Maven | |
run: ./mvnw -ntp deploy -Pgithub -DskipTests -e -T 4C -s $GITHUB_WORKSPACE/settings.xml | |
env: | |
GITHUB_TOKEN: ${{ github.token }} |