Skip to content

Commit a5921fd

Browse files
committed
chore: Add Maven wrapper and CI tooling
Add mvnw / .mvn so contributors and CI can build with a pinned Maven version without a system install. Exclude the wrapper scripts from pre-commit formatting. Refactor commit.yaml to share checkout/setup steps via YAML anchors and grant the release job contents: write so conventional-release can create the GitHub release and tag.
1 parent 8962664 commit a5921fd

6 files changed

Lines changed: 510 additions & 13 deletions

File tree

.github/workflows/commit.yaml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
name: Commit
22
on: push
33

4+
permissions:
5+
contents: read
6+
id-token: read
7+
48
jobs:
59
test:
610
runs-on: ubuntu-latest
711
steps:
8-
- uses: actions/checkout@v6
12+
- &checkout
13+
uses: actions/checkout@v6
914
with:
1015
fetch-depth: 0
1116

12-
- uses: actions/setup-java@v5
17+
- &setup-java
18+
uses: actions/setup-java@v5
1319
with:
1420
distribution: 'temurin'
1521
java-version-file: .java-version
@@ -32,18 +38,13 @@ jobs:
3238
release:
3339
if: github.ref == 'refs/heads/master'
3440
runs-on: ubuntu-latest
35-
needs:
36-
- test
41+
needs: test
42+
permissions:
43+
contents: write
44+
id-token: write
3745
steps:
38-
- uses: actions/checkout@v6
39-
with:
40-
fetch-depth: 0
41-
42-
- uses: actions/setup-java@v5
43-
with:
44-
distribution: 'temurin'
45-
java-version-file: .java-version
46-
cache: 'maven'
46+
- *checkout
47+
- *setup-java
4748

4849
- name: Create release
4950
uses: extenda/actions/conventional-release@v0

.mvn/extensions.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>com.google.cloud.artifactregistry</groupId>
5+
<artifactId>artifactregistry-maven-wagon</artifactId>
6+
<version>2.2.5</version>
7+
</extension>
8+
</extensions>
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.16/apache-maven-3.9.16-bin.zip

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
default_stages: [pre-commit]
2+
exclude: ^mvnw.*$
23
repos:
34
- repo: https://github.com/pre-commit/pre-commit-hooks
45
rev: v6.0.0

mvnw

Lines changed: 295 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)