-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from paketo-buildpacks/maven-4
Add Maven 4
- Loading branch information
Showing
8 changed files
with
264 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
name: Update Maven 4 | ||
"on": | ||
schedule: | ||
- cron: 0 5 * * 1-5 | ||
workflow_dispatch: {} | ||
jobs: | ||
update: | ||
name: Update Buildpack Dependency | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.18" | ||
- name: Install update-buildpack-dependency | ||
run: | | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest | ||
- name: Install yj | ||
run: | | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
echo "Installing yj ${YJ_VERSION}" | ||
mkdir -p "${HOME}"/bin | ||
echo "${HOME}/bin" >> "${GITHUB_PATH}" | ||
curl \ | ||
--location \ | ||
--show-error \ | ||
--silent \ | ||
--output "${HOME}"/bin/yj \ | ||
"https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux" | ||
chmod +x "${HOME}"/bin/yj | ||
env: | ||
YJ_VERSION: 5.0.0 | ||
- uses: actions/checkout@v3 | ||
- id: dependency | ||
uses: docker://ghcr.io/paketo-buildpacks/actions/maven-dependency:main | ||
with: | ||
artifact_id: apache-maven | ||
classifier: bin | ||
group_id: org.apache.maven | ||
packaging: tar.gz | ||
uri: https://repo1.maven.org/maven2 | ||
version_regex: ^4\\.[\\d]+\\.[\\d]+-.*$ | ||
- name: Update Buildpack Dependency | ||
id: buildpack | ||
run: |- | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
OLD_VERSION=$(yj -tj < buildpack.toml | jq -r " | ||
.metadata.dependencies[] | | ||
select( .id == env.ID ) | | ||
select( .version | test( env.VERSION_PATTERN ) ) | | ||
.version") | ||
update-buildpack-dependency \ | ||
--buildpack-toml buildpack.toml \ | ||
--id "${ID}" \ | ||
--version-pattern "${VERSION_PATTERN}" \ | ||
--version "${VERSION}" \ | ||
--cpe-pattern "${CPE_PATTERN:-}" \ | ||
--cpe "${CPE:-}" \ | ||
--purl-pattern "${PURL_PATTERN:-}" \ | ||
--purl "${PURL:-}" \ | ||
--uri "${URI}" \ | ||
--sha256 "${SHA256}" | ||
git add buildpack.toml | ||
git checkout -- . | ||
if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then | ||
LABEL="semver:major" | ||
elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then | ||
LABEL="semver:minor" | ||
else | ||
LABEL="semver:patch" | ||
fi | ||
echo "::set-output name=old-version::${OLD_VERSION}" | ||
echo "::set-output name=new-version::${VERSION}" | ||
echo "::set-output name=version-label::${LABEL}" | ||
env: | ||
CPE: ${{ steps.dependency.outputs.cpe }} | ||
CPE_PATTERN: "" | ||
ID: maven | ||
PURL: ${{ steps.dependency.outputs.purl }} | ||
PURL_PATTERN: "" | ||
SHA256: ${{ steps.dependency.outputs.sha256 }} | ||
URI: ${{ steps.dependency.outputs.uri }} | ||
VERSION: ${{ steps.dependency.outputs.version }} | ||
VERSION_PATTERN: ^4\.[\d]+\.[\d]+ | ||
- uses: peter-evans/create-pull-request@v4 | ||
with: | ||
author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> | ||
body: Bumps `Maven 4` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. | ||
branch: update/buildpack/maven-4 | ||
commit-message: |- | ||
Bump Maven 4 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} | ||
Bumps Maven 4 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. | ||
delete-branch: true | ||
labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade | ||
signoff: true | ||
title: Bump Maven 4 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} | ||
token: ${{ secrets.JAVA_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,12 @@ api = "0.7" | |
description = "the path to a Maven settings file" | ||
name = "BP_MAVEN_SETTINGS_PATH" | ||
|
||
[[metadata.configurations]] | ||
build = true | ||
default = "3" | ||
description = "the Maven version" | ||
name = "BP_MAVEN_VERSION" | ||
|
||
[[metadata.configurations]] | ||
build = true | ||
default = "" | ||
|
@@ -92,6 +98,20 @@ api = "0.7" | |
type = "Apache-2.0" | ||
uri = "https://www.apache.org/licenses/" | ||
|
||
[[metadata.dependencies]] | ||
cpes = ["cpe:2.3:a:apache:maven:4.0.0:*:*:*:*:*:*:*"] | ||
id = "maven" | ||
name = "Apache Maven" | ||
purl = "pkg:generic/[email protected]" | ||
sha256 = "4b133c01af2559501c13e6366149c65db87178d0ac354fd1f3204463b6bac7b2" | ||
stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"] | ||
uri = "https://repo1.maven.org/maven2/org/apache/maven/apache-maven/4.0.0-alpha-2/apache-maven-4.0.0-alpha-2-bin.tar.gz" | ||
version = "4.0.0" | ||
|
||
[[metadata.dependencies.licenses]] | ||
type = "Apache-2.0" | ||
uri = "https://www.apache.org/licenses/" | ||
|
||
[[metadata.dependencies]] | ||
cpes = ["cpe:2.3:a:apache:mvnd:0.8.2:*:*:*:*:*:*:*"] | ||
id = "mvnd" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.