Skip to content

Commit 35182af

Browse files
authored
Merge branch 'main' into O363-CVE
2 parents d6e0463 + 742cbc0 commit 35182af

14 files changed

Lines changed: 801 additions & 196 deletions

File tree

.github/workflows/build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
java: [ '11', '17', '21', '25' ]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Setup Java
23+
uses: actions/setup-java@v5
24+
with:
25+
java-version: ${{ matrix.java }}
26+
distribution: 'zulu'
27+
cache: maven
28+
29+
- name: Build
30+
run: ./mvnw -ntp -B verify

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
steps:
4242
- name: Checkout repository
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v6
4444

4545
# Initializes the CodeQL tools for scanning.
4646
- name: Initialize CodeQL

.github/workflows/maven.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to release (e.g. 1.0.0)'
8+
required: true
9+
type: string
10+
next_version:
11+
description: 'Next development version (e.g. 1.0.1-SNAPSHOT)'
12+
required: true
13+
type: string
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
packages: write
21+
id-token: write
22+
issues: write
23+
pull-requests: write
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v6
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Set up JDK
32+
uses: actions/setup-java@v5
33+
with:
34+
distribution: zulu
35+
java-version: 11
36+
cache: maven
37+
38+
- name: Set version
39+
run: |
40+
# Configure git for any operations
41+
git config --global user.name "GitHub Actions"
42+
git config --global user.email "actions@github.com"
43+
44+
# Check if we already have the release commit
45+
if git log --oneline -10 | grep -q "Release version ${{ github.event.inputs.version }}"; then
46+
echo "Release commit already exists, skipping version setting"
47+
elif [ "$CURRENT_VERSION" != "${{ github.event.inputs.version }}" ]; then
48+
echo "Setting version to ${{ github.event.inputs.version }}"
49+
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.version }}
50+
git add pom.xml "**/pom.xml"
51+
git commit -m "Release version ${{ github.event.inputs.version }}"
52+
git push origin main
53+
else
54+
echo "Version is already set to ${{ github.event.inputs.version }}"
55+
fi
56+
57+
- name: Build
58+
run: ./mvnw -Ppublication
59+
60+
- name: Release
61+
env:
62+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
64+
JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
65+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
66+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
67+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
68+
run: ./mvnw -N -Ppublication jreleaser:full-release
69+
70+
- name: Set next version
71+
if: github.event_name == 'workflow_dispatch'
72+
run: |
73+
# Configure git (in case it's needed again)
74+
git config --global user.name "GitHub Actions"
75+
git config --global user.email "actions@github.com"
76+
77+
echo "Setting next version to ${{ github.event.inputs.next_version }}"
78+
mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.next_version }}
79+
git add pom.xml "**/pom.xml"
80+
git commit -m "Prepare for next development version"
81+
git push origin main

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
target
44
.classpath
55
.project
6-
.settings
6+
.settings
7+
.idea
8+
out
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip

empiricism/pom.xml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22
<modelVersion>4.0.0</modelVersion>
3-
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
43
<artifactId>empiricism</artifactId>
54
<version>20240325.2-SNAPSHOT</version>
65
<packaging>jar</packaging>
76
<parent>
8-
<relativePath>..</relativePath>
97
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
108
<artifactId>parent</artifactId>
119
<version>20240325.2-SNAPSHOT</version>
1210
</parent>
1311

1412
<name>empiricism</name>
13+
<url>https://github.com/OWASP/java-html-sanitizer</url>
1514
<description>
1615
HTML metadata derived by interrogating a browser's HTML parser
1716
</description>
1817

19-
<build>
20-
<plugins>
21-
<plugin>
22-
<artifactId>maven-compiler-plugin</artifactId>
23-
<configuration>
24-
<source>1.8</source>
25-
<target>1.8</target>
26-
</configuration>
27-
</plugin>
28-
</plugins>
29-
</build>
30-
3118
<dependencies>
3219
<dependency>
3320
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>

java10-shim/pom.xml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,24 @@
33
<artifactId>java10-shim</artifactId>
44
<packaging>jar</packaging>
55
<parent>
6-
<relativePath>..</relativePath>
76
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
87
<artifactId>parent</artifactId>
98
<version>20240325.2-SNAPSHOT</version>
109
</parent>
1110

1211
<name>Java 10 Shim</name>
12+
<url>https://github.com/OWASP/java-html-sanitizer</url>
1313
<description>
1414
Provides an implementation of java8-shim that interoperates with
1515
Java &gt;= 10 idioms for immutable collections.
1616
</description>
1717

18+
<properties>
19+
<maven.compiler.release>10</maven.compiler.release>
20+
</properties>
21+
1822
<build>
1923
<plugins>
20-
<plugin>
21-
<groupId>org.apache.maven.plugins</groupId>
22-
<artifactId>maven-compiler-plugin</artifactId>
23-
<configuration>
24-
<release>10</release>
25-
</configuration>
26-
</plugin>
2724
<plugin>
2825
<groupId>org.apache.maven.plugins</groupId>
2926
<artifactId>maven-release-plugin</artifactId>

java8-shim/pom.xml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,19 @@
33
<artifactId>java8-shim</artifactId>
44
<packaging>jar</packaging>
55
<parent>
6-
<relativePath>..</relativePath>
76
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
87
<artifactId>parent</artifactId>
98
<version>20240325.2-SNAPSHOT</version>
109
</parent>
1110

1211
<name>Java 8 Shim</name>
12+
<url>https://github.com/OWASP/java-html-sanitizer</url>
1313
<description>
1414
Backports @since Java 9 collection factories like List.of onto
1515
Java8 in a way that uses the real ones where available, falls back
1616
to a conforming implementation on Java8 and JIT compiles well.
1717
</description>
1818

19-
<build>
20-
<plugins>
21-
<plugin>
22-
<groupId>org.apache.maven.plugins</groupId>
23-
<artifactId>maven-compiler-plugin</artifactId>
24-
<configuration>
25-
<release>8</release>
26-
</configuration>
27-
</plugin>
28-
</plugins>
29-
</build>
30-
3119
<dependencies>
3220
<dependency>
3321
<groupId>junit</groupId>

0 commit comments

Comments
 (0)