Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release automation #176

Merged
merged 5 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 15
target-branch: master
- package-ecosystem: maven
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
4 changes: 4 additions & 0 deletions .github/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: Weld Parent
release:
current-version: 4.0.2.Final
next-version: 4.0.3-SNAPSHOT
Binary file added .github/release/maven-settings.xml.gpg
Binary file not shown.
Binary file added .github/release/weld-sign.asc.gpg
Binary file not shown.
8 changes: 6 additions & 2 deletions .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Weld-JUnit CI
name: Weld Testing CI

on:
pull_request:
branches: [ master ]

jobs:
build-weld-junit:
name: "Weld-JUnit build, JDK ${{matrix.java.name}}"
name: "Weld Testing build, JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -19,6 +19,10 @@ jobs:
name: "17",
java-version: 17,
}
- {
name: "21",
java-version: 21,
}
steps:
- uses: actions/checkout@v4
- name: Set up JDK @{}
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Weld Testing Release

on:
pull_request:
types:
- closed
paths:
- '.github/project.yml'

jobs:
release:
name: Release
runs-on: ubuntu-latest
if: ${{github.event.pull_request.merged == true}}
env:
GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}}
steps:
- name: Retrieve project metadata
id: metadata
uses: radcortez/project-metadata-action@master
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{secrets.RELEASE_TOKEN}}

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: Set up Maven
uses: stCarolas/[email protected]
with:
maven-version: 3.8.8

- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED"
java -version
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output weld-sign.asc .github/release/weld-sign.asc.gpg
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
gpg --fast-import --no-tty --batch --yes weld-sign.asc
git config --global user.name "Weld CI"
git config --global user.email "[email protected]"
git checkout -b release
mvn release:prepare --batch-mode -Drelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -Dtag=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -s maven-settings.xml
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -Drelease -s maven-settings.xml
git push
git push --tags
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import jakarta.enterprise.inject.spi.Prioritized;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
* A subclass of {@link MockBean} implementing {@link Prioritized} hence allowing for globally enabled alternatives.
* Used instead of {@link MockBean} if user specified {@link MockBean.Builder#priority(int)}.
Expand All @@ -16,6 +18,7 @@ class MockBeanWithPriority<T> extends MockBean<T> implements Prioritized {

private final int priority;

@SuppressFBWarnings(value = "CT_CONSTRUCTOR_THROW", justification = "This is just a helper class for testing. Plus finalizer pattern is pretty much dead since deprecation in Java 9.")
MockBeanWithPriority(Class<?> beanClass, Set<Class<? extends Annotation>> stereotypes, boolean alternative,
boolean selectForSyntheticBeanArchive, int priority, String name,
Set<Annotation> qualifiers, Set<Type> types, Class<? extends Annotation> scope,
Expand Down
11 changes: 4 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-parent</artifactId>
<version>47</version>
<version>50</version>
</parent>

<url>http://weld.cdi-spec.org</url>
Expand Down Expand Up @@ -44,7 +44,7 @@
<version.junit.jupiter>5.10.0</version.junit.jupiter>
<version.spock>2.1-groovy-3.0</version.spock>
<version.junit.platform>1.8.2</version.junit.platform>
<version.groovy>3.0.10</version.groovy>
<version.groovy>3.0.21</version.groovy>
<version.weld>5.1.2.Final</version.weld>
<version.mockito>4.4.0</version.mockito>
<version.jakarta.ejb.api>4.0.1</version.jakarta.ejb.api>
Expand All @@ -53,8 +53,8 @@
<version.jpa-api>3.1.0</version.jpa-api>
<version.log4j>2.17.2</version.log4j>
<!-- SpotBugs properties -->
<version.spotbugs>4.6.0</version.spotbugs>
<version.spotbugs.plugin>4.6.0.0</version.spotbugs.plugin>
<version.spotbugs>4.8.3</version.spotbugs>
<version.spotbugs.plugin>4.8.3.1</version.spotbugs.plugin>
<spotbugs.failOnError>false</spotbugs.failOnError>
<spotbugs.threshold>Low</spotbugs.threshold>
</properties>
Expand Down Expand Up @@ -211,8 +211,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!--Minimal version with Junit 5 engine support-->
<version>2.22.1</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.config.file>${project.build.testOutputDirectory}/logging.properties</java.util.logging.config.file>
Expand All @@ -222,7 +220,6 @@
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.13.1</version>
<executions>
<execution>
<goals>
Expand Down
Loading