Skip to content

Commit 709ed6e

Browse files
authored
Merge pull request #34 from secure-software-engineering/develop
Update master
2 parents 8588e89 + bdfa58a commit 709ed6e

File tree

9 files changed

+121
-129
lines changed

9 files changed

+121
-129
lines changed

.classpath

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

.github/workflows/deploy.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,19 @@ jobs:
88
name: PathExpression deployment
99
steps:
1010
- name: Checkout source code
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
# Sets up Java version
1313
- name: Set up Java
14-
uses: actions/setup-java@v3
14+
uses: actions/setup-java@v4
1515
with:
1616
distribution: 'adopt'
1717
java-package: 'jdk'
18-
java-version: '11'
18+
java-version: '8'
1919
server-id: 'ossrh' # must match the serverId configured for the nexus-staging-maven-plugin
2020
server-username: OSSRH_USERNAME # Env var that holds your OSSRH user name
2121
server-password: OSSRH_PASSWORD # Env var that holds your OSSRH user pw
2222
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Substituted with the value stored in the referenced secret
2323
gpg-passphrase: SIGN_KEY_PASS # Env var that holds the key's passphrase
24-
# Sets up Maven version
25-
- name: Set up Maven
26-
uses: stCarolas/[email protected]
27-
with:
28-
maven-version: 3.6.3
2924
- name: Build & Deploy PathExpression
3025
run: mvn -B -U clean deploy -Pdeployment
3126
env:

.github/workflows/maven.yml

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,12 @@ jobs:
88
BuildAndTest:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- name: Set up JDK 1.8
13-
uses: actions/setup-java@v1
13+
uses: actions/setup-java@v4
1414
with:
15-
java-version: 1.8
15+
distribution: 'adopt'
16+
java-package: jdk
17+
java-version: '8'
1618
- name: Build with Maven
1719
run: mvn -B verify --file pom.xml
18-
19-
Release:
20-
name: Release
21-
if: github.ref == 'refs/heads/master'
22-
runs-on: ubuntu-latest
23-
permissions:
24-
contents: read
25-
packages: write
26-
needs: [BuildAndTest]
27-
steps:
28-
- name: Checkout
29-
uses: actions/checkout@v2
30-
- name: Set up JDK 1.8
31-
uses: actions/setup-java@v1
32-
with:
33-
java-version: 1.8
34-
- name: Release
35-
uses: qcastel/github-actions-maven-release@master
36-
env:
37-
JAVA_HOME: /usr/lib/jvm/java-1.8-openjdk/
38-
with:
39-
release-branch-name: "master"
40-
41-
gpg-enabled: "true"
42-
gpg-key-id: ${{ secrets.GPG_KEY_ID }}
43-
gpg-key: ${{ secrets.GPG_KEY }}
44-
45-
maven-repo-server-id: github
46-
maven-repo-server-username: ${{ secrets.CI_USER }}
47-
maven-repo-server-password: ${{ secrets.CI_PACKAGES_TOKEN }}
48-
49-
git-release-bot-name: ${{ secrets.CI_USER }}
50-
git-release-bot-email: "[email protected]"
51-
52-
access-token: ${{ secrets.GITHUB_TOKEN }}
53-
maven-args: "-DskipTests"

.github/workflows/version.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Version handling
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- master
9+
10+
jobs:
11+
version-update:
12+
# This version does not run on self-opened PRs
13+
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.user.login != 'github-actions[bot]' }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout source code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
# Sets up Java version
21+
- name: Set up Java
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'adopt'
25+
java-package: jdk
26+
java-version: '8'
27+
# Semantic versioning
28+
- name: Semantic versioning
29+
id: versioning
30+
uses: paulhatch/[email protected]
31+
with:
32+
tag_prefix: ""
33+
# A string which, if present in a git commit, indicates that a change represents a
34+
# major (breaking) change, supports regular expressions wrapped with '/'
35+
major_pattern: "(MAJOR)"
36+
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
37+
minor_pattern: "(MINOR)"
38+
# A string to determine the format of the version output
39+
version_format: "${major}.${minor}.${patch}"
40+
# Check, whether there is an existing branch "version_<version>" or an open PR "version_<version>" -> "master"
41+
# and store the results as environment variables
42+
- name: Check if branch and PR exist
43+
# The second command was copied from https://stackoverflow.com/questions/73812503/github-action-stop-the-action-if-pr-already-exists
44+
run: |
45+
echo VERSION_BRANCH_EXISTS=$(git ls-remote --heads origin refs/heads/version_${{ steps.versioning.outputs.version }} | wc -l) >> $GITHUB_ENV
46+
echo PR_EXISTS=$(gh pr list \
47+
--repo "$GITHUB_REPOSITORY" \
48+
--json baseRefName,headRefName \
49+
--jq '
50+
map(select(.baseRefName == "master" and .headRefName == "version_${{ steps.versioning.outputs.version }}"))
51+
| length
52+
') >> $GITHUB_ENV
53+
env:
54+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
# If the branch "version_<version>" does not exist, create the branch and update the version in all files
56+
- name: Create branch and update PathExpression version
57+
if: ${{ env.VERSION_BRANCH_EXISTS == '0' }}
58+
run: |
59+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
60+
git config --global user.name "github-actions[bot]"
61+
git checkout -b version_${{ steps.versioning.outputs.version }}
62+
mvn build-helper:parse-version versions:set -DnewVersion=\${{ steps.versioning.outputs.version }} versions:commit
63+
git ls-files | grep 'pom.xml$' | xargs git add
64+
git commit --allow-empty -am "Update PathExpression version to ${{ steps.versioning.outputs.version }}"
65+
git push origin version_${{ steps.versioning.outputs.version }}
66+
# If a PR "version_<version>" -> "master" does not exist, create the PR
67+
- name: Open pull request for version update
68+
if: ${{ env.PR_EXISTS == '0' }}
69+
run: |
70+
gh pr create -B master -H version_${{ steps.versioning.outputs.version }} -t "Update PathExpression version to ${{ steps.versioning.outputs.version }}" -b "This PR was created by the version-update workflow. Please make sure to delete the branch after merging, otherwise future workflows might fail."
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
74+
version-release:
75+
# This job runs only on merged PRs, which were opened by the version-update job
76+
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.user.login == 'github-actions[bot]' }}
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Checkout source code
80+
uses: actions/checkout@v4
81+
with:
82+
fetch-depth: 0
83+
# Semantic versioning
84+
- name: Semantic versioning
85+
id: versioning
86+
uses: paulhatch/[email protected]
87+
with:
88+
tag_prefix: ""
89+
# A string which, if present in a git commit, indicates that a change represents a
90+
# major (breaking) change, supports regular expressions wrapped with '/'
91+
major_pattern: "(MAJOR)"
92+
# Same as above except indicating a minor change, supports regular expressions wrapped with '/'
93+
minor_pattern: "(MINOR)"
94+
# A string to determine the format of the version output
95+
version_format: "${major}.${minor}.${patch}"
96+
# Create a tag with the newest version to prepare a release
97+
- name: Create tag for new version
98+
run: |
99+
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
100+
git config --global user.name "${{ github.actor }}"
101+
git tag -a ${{ steps.versioning.outputs.version }} -m "PathExpression version ${{ steps.versioning.outputs.version }}"
102+
git push origin ${{ steps.versioning.outputs.version }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ local.properties
101101
.settings/
102102
.loadpath
103103
.recommenders
104+
.project
105+
.classpath
104106

105107
# External tool builders
106108
.externalToolBuilders/

.project

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

.whitesource

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

pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<plugin>
4040
<groupId>org.sonatype.plugins</groupId>
4141
<artifactId>nexus-staging-maven-plugin</artifactId>
42-
<version>1.6.13</version>
42+
<version>1.7.0</version>
4343
<extensions>true</extensions>
4444
<configuration>
4545
<serverId>ossrh</serverId>
@@ -50,7 +50,7 @@
5050
<plugin>
5151
<groupId>org.apache.maven.plugins</groupId>
5252
<artifactId>maven-source-plugin</artifactId>
53-
<version>3.2.1</version>
53+
<version>3.3.1</version>
5454
<executions>
5555
<execution>
5656
<id>attach-source</id>
@@ -63,7 +63,7 @@
6363
<plugin>
6464
<groupId>org.apache.maven.plugins</groupId>
6565
<artifactId>maven-javadoc-plugin</artifactId>
66-
<version>3.6.0</version>
66+
<version>3.8.0</version>
6767
<executions>
6868
<execution>
6969
<id>attach-javadoc</id>
@@ -76,7 +76,7 @@
7676
<plugin>
7777
<groupId>org.apache.maven.plugins</groupId>
7878
<artifactId>maven-gpg-plugin</artifactId>
79-
<version>3.0.1</version>
79+
<version>3.2.5</version>
8080
<executions>
8181
<execution>
8282
<id>sign-artifacts</id>
@@ -103,15 +103,15 @@
103103
<plugins>
104104
<plugin>
105105
<artifactId>maven-compiler-plugin</artifactId>
106-
<version>3.3</version>
106+
<version>3.13.0</version>
107107
<configuration>
108108
<source>1.7</source>
109109
<target>1.7</target>
110110
</configuration>
111111
</plugin>
112112
<plugin>
113113
<artifactId>maven-release-plugin</artifactId>
114-
<version>2.5.3</version>
114+
<version>3.1.1</version>
115115
</plugin>
116116
</plugins>
117117
</build>
@@ -120,18 +120,18 @@
120120
<dependency>
121121
<groupId>com.google.guava</groupId>
122122
<artifactId>guava</artifactId>
123-
<version>32.0.0-jre</version>
123+
<version>33.3.0-jre</version>
124124
</dependency>
125125
<dependency>
126126
<groupId>junit</groupId>
127127
<artifactId>junit</artifactId>
128-
<version>4.13.1</version>
128+
<version>4.13.2</version>
129129
<scope>test</scope>
130130
</dependency>
131131
<dependency>
132132
<groupId>org.apache.logging.log4j</groupId>
133133
<artifactId>log4j-core</artifactId>
134-
<version>2.17.1</version>
134+
<version>2.23.1</version>
135135
</dependency>
136136
</dependencies>
137137

shippable.yml

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

0 commit comments

Comments
 (0)