add github actions
This commit is contained in:
38
.github/workflows/artifactory-milestone-release.yml
vendored
Normal file
38
.github/workflows/artifactory-milestone-release.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Artifactory Milestone Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseVersion:
|
||||
description: "Milestone release version"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Release milestone to Artifactory
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Capture release version
|
||||
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
|
||||
|
||||
- name: Update release version
|
||||
run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
|
||||
|
||||
- name: Enforce release rules
|
||||
run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
|
||||
|
||||
- name: Build with Maven and deploy to Artifactory's milestone repository
|
||||
env:
|
||||
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
run: mvn -P artifactory-milestone -s settings.xml --batch-mode -Dmaven.test.skip=true deploy
|
||||
38
.github/workflows/artifactory-staging.yml
vendored
Normal file
38
.github/workflows/artifactory-staging.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Artifactory Staging
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseVersion:
|
||||
description: "Release version"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Stage release to Artifactory
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Capture release version
|
||||
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
|
||||
|
||||
- name: Update release version
|
||||
run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
|
||||
|
||||
- name: Enforce release rules
|
||||
run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
|
||||
|
||||
- name: Build with Maven and deploy to Artifactory staging repository
|
||||
env:
|
||||
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
run: mvn -P artifactory-staging -s settings.xml --batch-mode -Dmaven.test.skip=true deploy
|
||||
32
.github/workflows/continuous-inspection.yml
vendored
Normal file
32
.github/workflows/continuous-inspection.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Continuous inspection build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *' # Once per day at 10am UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
code-quality-analysis:
|
||||
name: code quality analysis report
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Analyse test coverage with Jacoco
|
||||
run: mvn -P test-coverage verify
|
||||
|
||||
- name: Analyse code quality with Sonar
|
||||
if: github.repository == 'spring-experimental/spring-ai'
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
|
||||
run: mvn sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN
|
||||
|
||||
57
.github/workflows/continuous-integration.yml
vendored
Normal file
57
.github/workflows/continuous-integration.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: CI/CD build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main-x" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build branch
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
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 and deploy to Artifactory
|
||||
env:
|
||||
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
||||
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||
run: mvn -s settings.xml --batch-mode --update-snapshots deploy
|
||||
|
||||
- name: Generate Java docs
|
||||
run: mvn javadoc:aggregate
|
||||
|
||||
- name: Generate Reference docs
|
||||
working-directory: spring-ai-docs
|
||||
run: mvn site
|
||||
|
||||
- name: Capture project version
|
||||
run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
|
||||
|
||||
- name: Setup SSH key
|
||||
env:
|
||||
DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
|
||||
DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }}
|
||||
run: |
|
||||
mkdir "$HOME/.ssh"
|
||||
echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key"
|
||||
chmod 600 "$HOME/.ssh/key"
|
||||
echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
|
||||
|
||||
- name: Deploy docs
|
||||
env:
|
||||
DOCS_HOST: ${{ secrets.DOCS_HOST }}
|
||||
DOCS_PATH: ${{ secrets.DOCS_PATH }}
|
||||
DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
|
||||
working-directory: spring-ai-docs
|
||||
run: |
|
||||
cd target && unzip spring-ai-$PROJECT_VERSION-docs.zip
|
||||
scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION
|
||||
scp -i $HOME/.ssh/key -r reference $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION
|
||||
56
.github/workflows/documentation-upload.yml
vendored
Normal file
56
.github/workflows/documentation-upload.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: Documentation Upload
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseVersion:
|
||||
description: "Release version"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Capture release version
|
||||
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Generate Java docs
|
||||
run: mvn javadoc:aggregate
|
||||
|
||||
- name: Generate Reference docs
|
||||
working-directory: spring-ai-docs
|
||||
run: mvn site
|
||||
|
||||
- name: Setup SSH key
|
||||
env:
|
||||
DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
|
||||
DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }}
|
||||
run: |
|
||||
mkdir "$HOME/.ssh"
|
||||
echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key"
|
||||
chmod 600 "$HOME/.ssh/key"
|
||||
echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
|
||||
|
||||
- name: Deploy docs
|
||||
env:
|
||||
DOCS_HOST: ${{ secrets.DOCS_HOST }}
|
||||
DOCS_PATH: ${{ secrets.DOCS_PATH }}
|
||||
DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
|
||||
working-directory: spring-ai-docs/target
|
||||
run: |
|
||||
unzip spring-ai-$RELEASE_VERSION-docs.zip
|
||||
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST cd $DOCS_PATH && mkdir $RELEASE_VERSION
|
||||
scp -i $HOME/.ssh/key -r api reference $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$RELEASE_VERSION
|
||||
ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST rm current && ln -s $RELEASE_VERSION current
|
||||
|
||||
81
.github/workflows/maven-central-release.yml
vendored
Normal file
81
.github/workflows/maven-central-release.yml
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
name: Maven Central Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseVersion:
|
||||
description: "Release version"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Capture release version
|
||||
run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
|
||||
|
||||
- name: Prepare directory structure
|
||||
run: |
|
||||
mkdir -p nexus/org/springframework/batch/spring-batch-bom/$RELEASE_VERSION
|
||||
mkdir -p nexus/org/springframework/batch/spring-batch-infrastructure/$RELEASE_VERSION
|
||||
mkdir -p nexus/org/springframework/batch/spring-batch-core/$RELEASE_VERSION
|
||||
mkdir -p nexus/org/springframework/batch/spring-batch-test/$RELEASE_VERSION
|
||||
mkdir -p nexus/org/springframework/batch/spring-batch-integration/$RELEASE_VERSION
|
||||
|
||||
- name: Download release files from Artifactory
|
||||
env:
|
||||
ARTIFACTORY_URL: "https://repo.spring.io/libs-staging-local/org/springframework/batch"
|
||||
run: |
|
||||
echo "Downloading BOM artifacts"
|
||||
cd nexus/org/springframework/batch/spring-batch-bom/$RELEASE_VERSION
|
||||
wget $ARTIFACTORY_URL/spring-batch-bom/$RELEASE_VERSION/spring-batch-bom-$RELEASE_VERSION.pom
|
||||
|
||||
echo "Downloading infrastructure artifacts"
|
||||
cd ../../../../../..
|
||||
cd nexus/org/springframework/batch/spring-batch-infrastructure/$RELEASE_VERSION
|
||||
wget $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION.pom
|
||||
wget $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION-javadoc.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-infrastructure/$RELEASE_VERSION/spring-batch-infrastructure-$RELEASE_VERSION-sources.jar
|
||||
|
||||
echo "Downloading core artifacts"
|
||||
cd ../../../../../..
|
||||
cd nexus/org/springframework/batch/spring-batch-core/$RELEASE_VERSION
|
||||
wget $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION.pom
|
||||
wget $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION-javadoc.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-core/$RELEASE_VERSION/spring-batch-core-$RELEASE_VERSION-sources.jar
|
||||
|
||||
echo "Downloading test artifacts"
|
||||
cd ../../../../../..
|
||||
cd nexus/org/springframework/batch/spring-batch-test/$RELEASE_VERSION
|
||||
wget $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION.pom
|
||||
wget $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION-javadoc.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-test/$RELEASE_VERSION/spring-batch-test-$RELEASE_VERSION-sources.jar
|
||||
|
||||
echo "Downloading integration artifacts"
|
||||
cd ../../../../../..
|
||||
cd nexus/org/springframework/batch/spring-batch-integration/$RELEASE_VERSION
|
||||
wget $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION.pom
|
||||
wget $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION-javadoc.jar
|
||||
wget $ARTIFACTORY_URL/spring-batch-integration/$RELEASE_VERSION/spring-batch-integration-$RELEASE_VERSION-sources.jar
|
||||
|
||||
- name: Sign artifacts and release them to Maven Central
|
||||
uses: jvalkeal/nexus-sync@v0
|
||||
id: nexus
|
||||
with:
|
||||
url: ${{ secrets.OSSRH_URL }}
|
||||
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
|
||||
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
|
||||
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
|
||||
create: true
|
||||
upload: true
|
||||
close: true
|
||||
release: true
|
||||
generate-checksums: true
|
||||
pgp-sign: true
|
||||
pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
58
.github/workflows/maven-central-stage.yml
vendored
Normal file
58
.github/workflows/maven-central-stage.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: Maven Central Staging
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
buildName:
|
||||
description: "Artifactory build name"
|
||||
required: true
|
||||
buildNumber:
|
||||
description: "Artifactory build number"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
# to get spec file in .github
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
# Setup jfrog cli
|
||||
- uses: jfrog/setup-jfrog-cli@v1
|
||||
with:
|
||||
version: 1.43.2
|
||||
env:
|
||||
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
|
||||
|
||||
# Extract build id from input
|
||||
- name: Extract Build Id
|
||||
run: |
|
||||
echo JFROG_CLI_BUILD_NAME=${{ github.event.inputs.buildName }} >> $GITHUB_ENV
|
||||
echo JFROG_CLI_BUILD_NUMBER=${{ github.event.inputs.buildNumber }} >> $GITHUB_ENV
|
||||
|
||||
# Download released files
|
||||
- name: Download Release Files
|
||||
run: |
|
||||
jfrog rt download \
|
||||
--spec .github/release-files-spec.json \
|
||||
--spec-vars "buildname=$JFROG_CLI_BUILD_NAME;buildnumber=$JFROG_CLI_BUILD_NUMBER"
|
||||
|
||||
# Create checksums, signatures and create staging repo on central and upload
|
||||
- uses: jvalkeal/nexus-sync@v0
|
||||
id: nexus
|
||||
with:
|
||||
url: ${{ secrets.OSSRH_URL }}
|
||||
username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
|
||||
password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
|
||||
staging-profile-name: ${{ secrets.OSSRH_STAGING_PROFILE_NAME }}
|
||||
create: true
|
||||
upload: true
|
||||
generate-checksums: true
|
||||
pgp-sign: true
|
||||
pgp-sign-passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
pgp-sign-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
|
||||
# Print staging repo id
|
||||
- name: Print Staging Repo Id
|
||||
run: echo ${{ steps.nexus.outputs.staged-repository-id }}
|
||||
54
.github/workflows/release-notes-generation.yml
vendored
Normal file
54
.github/workflows/release-notes-generation.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: Generate Release notes
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
milestoneNumber:
|
||||
description: "Milestone title"
|
||||
required: true
|
||||
generatorVersion:
|
||||
description: "Changelog Generator version"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Generate release notes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Capture milestone number and generator version
|
||||
run: |
|
||||
echo MILESTONE_NUMBER=${{ github.event.inputs.milestoneNumber }} >> $GITHUB_ENV
|
||||
echo GENERATOR_VERSION=${{ github.event.inputs.generatorVersion }} >> $GITHUB_ENV
|
||||
|
||||
- name: Download changelog generator
|
||||
run: wget https://github.com/spring-io/github-changelog-generator/releases/download/v$GENERATOR_VERSION/github-changelog-generator.jar
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Prepare configuration file
|
||||
run: |
|
||||
cat << EOF > application.yml
|
||||
changelog:
|
||||
repository: spring-exprimental/spring-ai
|
||||
sections:
|
||||
- title: ":star: New features"
|
||||
labels: [ "type: feature" ]
|
||||
- title: ":rocket: Enhancements"
|
||||
labels: [ "type: enhancement" ]
|
||||
- title: ":lady_beetle: Bug fixes"
|
||||
labels: [ "type: bug" ]
|
||||
- title: ":notebook_with_decorative_cover: Documentation"
|
||||
labels: [ "in: documentation" ]
|
||||
- title: ":hammer: Tasks"
|
||||
labels: [ "type: task" ]
|
||||
EOF
|
||||
|
||||
- name: Generate release notes
|
||||
run: java -jar github-changelog-generator.jar $MILESTONE_NUMBER release-notes.md
|
||||
|
||||
- name: Print release notes
|
||||
run: cat release-notes.md
|
||||
Reference in New Issue
Block a user