Snapshot build

* Rename modules to follow naming schema
* Deploy snapshot
* Provide ci and pr-ci build
This commit is contained in:
Fabian Krüger
2024-01-10 13:05:18 +00:00
committed by GitHub
parent d466412b06
commit cf7e358c66
21 changed files with 161 additions and 138 deletions

42
.github/workflows/ci-pr.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: CI PRs
on:
workflow_dispatch:
pull_request:
jobs:
build:
timeout-minutes: 15
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- nickname: win
os: windows-latest
java: 17
- nickname: macos
os: macos-latest
java: 17
- nickname: linux
os: ubuntu-latest
java: 17
name: CI Build ${{ matrix.nickname }}
steps:
- uses: actions/checkout@v4
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.6.3
- uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
cache: maven
- name: Verify formatting
run: ./mvnw -B -Pfunctional-tests spring-javaformat:validate
- name: Build (Windows and MacOS, no functional tests)
if: runner.os != 'Linux'
run: ./mvnw -B clean install
- name: Build (Linux)
if: runner.os == 'Linux'
run: ./mvnw -B -Pfunctional-tests clean install

91
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: CI
on:
workflow_dispatch:
push:
paths-ignore:
- '.github/**'
jobs:
build:
timeout-minutes: 15
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- nickname: win
os: windows-latest
java: 17
- nickname: macos
os: macos-latest
java: 17
- nickname: linux
os: ubuntu-latest
java: 17
name: CI Build ${{ matrix.nickname }}
steps:
- uses: actions/checkout@v4
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.6.3
- uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
# this takes minutes and stretches build time
# - name: Setup docker (missing on MacOS)
# if: runner.os == 'macos'
# run: |
# brew install docker
# colima start
#
# # For testcontainers to find the Colima socket
# # https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
# sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Verify formatting
run: ./mvnw -B -Pfunctional-tests spring-javaformat:validate
- name: Build (Windows and MacOS, no functional tests)
if: runner.os != 'Linux'
run: ./mvnw -B clean install
- name: Build (Linux)
if: runner.os == 'Linux'
run: ./mvnw -B -Pfunctional-tests clean install
deploy:
needs: build
if: |
github.ref_name == 'main' &&
github.repository == 'spring-projects/spring-rewrite-commons'
runs-on: ubuntu-latest
steps:
- uses: jfrog/setup-jfrog-cli@v3
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Deploy Snapshot
run: |
jf mvnc \
--server-id-deploy repo.spring.io \
--repo-deploy-releases release \
--repo-deploy-snapshots snapshot
echo JFROG_CLI_BUILD_NAME=spring-rewrite-commons-main >> $GITHUB_ENV
echo JFROG_CLI_BUILD_NUMBER=$GITHUB_RUN_NUMBER >> $GITHUB_ENV
jf mvn clean install -X -B -DskipTests
jf rt build-publish
# - uses: actions/checkout@v4
# - uses: jvalkeal/setup-maven@v1
# with:
# maven-version: 3.6.3
# - uses: actions/setup-java@v4
# with:
# distribution: liberica
# java-version: 17
# - name: Deploy Snapshot
# working-directory: ./spring-rewrite-commons-launcher
# env:
# ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
# ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
# run: ./mvnw -B -Partifactory,javadoc -DskipTests deploy

View File

@@ -1,66 +0,0 @@
name: CI
on:
workflow_dispatch:
pull_request:
push:
paths-ignore:
- '.github/**'
jobs:
build:
timeout-minutes: 15
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- nickname: win
os: windows-latest
java: 17
- nickname: macos
os: macos-latest
java: 17
- nickname: linux
os: ubuntu-latest
java: 17
name: CI Build ${{ matrix.nickname }}
steps:
- uses: actions/checkout@v4
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.6.3
- uses: actions/setup-java@v4
with:
distribution: liberica
java-version: ${{ matrix.java }}
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
brew install docker
colima start
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- name: Verify formatting
run: ./mvnw -B -Pfunctional-tests spring-javaformat:validate
- name: Build (Windows, no functional tests)
if: runner.os == 'Windows'
run: ./mvnw -B clean install
- name: Build (Non Windows)
if: runner.os != 'Windows'
run: ./mvnw -B -Pfunctional-tests clean install
deploy:
# Deploy when in own repo, on main, and previous build succeeded
if: |
github.ref == 'ref/head/main' &&
github.repository == 'spring-projects/spring-rewrite-commons'
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy Snapshot
env:
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
run: ./mvnw -B -DskipTests clean deploy -Partifactory

79
pom.xml
View File

@@ -13,9 +13,9 @@
<modules>
<module>spring-rewrite-commons-launcher</module>
<module>spring-rewrite-commons-docs</module>
<module>spring-rewrite-commons-examples</module>
<module>spring-rewrite-commons-gradle</module>
<!-- <module>spring-rewrite-commons-docs</module>-->
<!-- <module>spring-rewrite-commons-examples</module>-->
<!-- <module>spring-rewrite-commons-gradle</module>-->
</modules>
<organization>
@@ -82,8 +82,8 @@
<url>https://github.com/spring-projects/rewrite-commons</url>
<connection>scm:git:https://github.com/spring-projects/spring-rewrite-commons</connection>
<developerConnection>scm:git:https://github.com/spring-projects/spring-rewrite-commons.git</developerConnection>
<tag>spring-rewrite-commons-0.1.0</tag>
</scm>
<tag>HEAD</tag>
</scm>
<issueManagement>
<system>Github Issues</system>
<url>https://github.com/spring-projects/spring-rewrite-commons/issues</url>
@@ -92,16 +92,6 @@
<system>Github Actions</system>
<url>https://github.com/spring-projects/spring-rewrite-commons/actions</url>
</ciManagement>
<distributionManagement>
<snapshotRepository>
<id>spring-snapshots</id>
<url>https://repo.spring.io/libs-snapshot-local</url>
<layout>default</layout>
<releases>
<enabled>false</enabled>
</releases>
</snapshotRepository>
</distributionManagement>
<licenses>
<license>
<name>Apache-2.0</name>
@@ -272,58 +262,37 @@ limitations under the License.
</modules>
</profile>
<profile>
<id>artifactory</id>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
<id>javadoc</id>
<build>
<plugins>
<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>${artifactory-maven-plugin.version}</version>
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>deploy-to-artifactory</id>
<id>attach-javadocs</id>
<goals>
<goal>publish</goal>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
<configuration>
<publisher>
<contextUrl>https://repo.spring.io</contextUrl>
<!--suppress UnresolvedMavenProperty -->
<username>${env.ARTIFACTORY_USERNAME}</username>
<!--suppress UnresolvedMavenProperty -->
<password>${env.ARTIFACTORY_PASSWORD}</password>
<repoKey>libs-milestone-local</repoKey>
<snapshotRepoKey>libs-snapshot-local</snapshotRepoKey>
</publisher>
<buildInfo>
<buildName>CI build for sbm-support-rewrite ${project.version}</buildName>
</buildInfo>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-snapshot</id>
<url>https://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
</profile>
</profiles>
</project>

View File

@@ -12,7 +12,7 @@
</parent>
<groupId>com.example</groupId>
<artifactId>boot-3-upgrade-atomic</artifactId>
<artifactId>boot-3-upgrade-atomic-example</artifactId>
<name>Boot 3 Atomic Upgrade Example</name>

View File

@@ -11,7 +11,7 @@
</parent>
<groupId>com.example</groupId>
<artifactId>boot-3-upgrade-iterative</artifactId>
<artifactId>boot-3-upgrade-iterative-example</artifactId>
<name>Boot 3 Iterative Upgrade Example</name>
<description>Example of iterative Boot upgrade with PRs</description>

View File

@@ -17,8 +17,8 @@
<description>Examples using Spring Rewrite Commons</description>
<modules>
<module>boot-3-upgrade-atomic</module>
<module>boot-3-upgrade-iterative</module>
<module>boot-3-upgrade-atomic-example</module>
<module>boot-3-upgrade-iterative-example</module>
<module>list-applicable-recipes-example</module>
</modules>

View File

@@ -61,19 +61,6 @@
<dependencyManagement>
<dependencies>
<!-- <dependency>-->
<!-- <groupId>org.springframework.rewrite</groupId>-->
<!-- <artifactId>spring-rewrite-commons-launcher</artifactId>-->
<!-- <version>0.1.0-SNAPSHOT</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.rewrite</groupId>-->
<!-- <artifactId>spring-rewrite-commons-launcher</artifactId>-->
<!-- <classifier>tests</classifier>-->
<!-- <type>test-jar</type>-->
<!-- <version>0.1.0-SNAPSHOT</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>