This repository has been archived by the owner on Jan 12, 2024. It is now read-only.
[dependency] Bump spring-boot.version from 3.2.0 to 3.2.1 #53
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: Build-Deploy | |
on: | |
push: | |
branches-ignore: | |
- main | |
pull_request: | |
types: [closed] | |
jobs: | |
build-and-deploy-artifact: | |
name: Build and deploy to github package | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "write" | |
id-token: "write" | |
packages: "write" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Resolve/Update Dependencies | |
env: | |
GITHUB_USERNAME: x-access-token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: mvn --settings .m2/maven-settings.xml package dependency:resolve-plugins dependency:go-offline | |
- name: Build (and run tests) | |
env: | |
GITHUB_USERNAME: x-access-token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: mvn --settings .m2/maven-settings.xml clean install | |
- name: Save test results | |
run: | | |
mkdir -p ~/test-results/junit/ | |
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \; | |
- name: Setting version | |
env: | |
GITHUB_USERNAME: x-access-token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: github.base_ref == 'main' | |
run: | | |
export GIT_COMMIT_HASH=$(git log -n 1 --pretty=format:'%h') | |
export GIT_COMMIT_DATE=$(git log -1 --pretty='%ad' --date=format:'%Y%m%d%H%M%S') | |
export VERSION=1.${GIT_COMMIT_DATE}_${GIT_COMMIT_HASH} | |
echo "Setting version $VERSION" | |
mvn --settings .m2/maven-settings.xml versions:set -DnewVersion="$VERSION" | |
mvn --settings .m2/maven-settings.xml versions:commit | |
- name: Deploy to Github Package | |
if: github.base_ref == 'main' | |
env: | |
GITHUB_USERNAME: x-access-token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: mvn --settings .m2/maven-settings.xml source:jar-no-fork deploy -DskipTests=true -Dmaven.wagon.http.pool=false |