mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 16:25:49 +00:00
revert .yml and added comments
This commit is contained in:
parent
5863acecdf
commit
c59fdcfa56
1 changed files with 10 additions and 21 deletions
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
|
@ -3,45 +3,34 @@ name: Build and Test
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "*"
|
- "*" # Trigger on all branches
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main] # Trigger on pull requests to the 'main' branch
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest # Use the latest version of Ubuntu as the runner
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2 # Checkout your repository's code
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2 # Set up Java Development Kit (JDK) version 17
|
||||||
with:
|
with:
|
||||||
java-version: "17"
|
java-version: "17"
|
||||||
distribution: "adopt"
|
distribution: "adopt"
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn clean package
|
run: mvn clean package # Clean and package your Maven project
|
||||||
|
|
||||||
- name: Run tests with Maven
|
- name: Run tests with Maven
|
||||||
run: mvn test
|
run: mvn test # Run tests using Maven
|
||||||
|
|
||||||
# Store build artifacts for history
|
# Store build artifacts for history
|
||||||
- name: Archive Build Artifacts
|
- name: Archive Build Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2 # Upload build artifacts to the workflow
|
||||||
with:
|
with:
|
||||||
name: build-artifacts
|
name: build-artifacts # Name for the uploaded artifacts
|
||||||
path:
|
path:
|
||||||
target/
|
target/ # Path to the build artifacts (typically 'target/' for Maven)
|
||||||
|
|
||||||
# Create a release with the artifacts
|
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: target/*
|
|
||||||
tag_name: ${{ steps.get_tag.outputs.TAG }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue