diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index 65d76cd..d39766b 100644 --- a/.github/pipeline-descriptor.yml +++ b/.github/pipeline-descriptor.yml @@ -44,7 +44,7 @@ dependencies: token: ${{ secrets.JAVA_GITHUB_TOKEN }} - name: JDK 11 id: jdk - version_pattern: "11(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + version_pattern: "^11(?:\\.[\\d]+(?:\\.[\\d]+)?)?" cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main with: @@ -55,7 +55,7 @@ dependencies: token: ${{ secrets.JAVA_GITHUB_TOKEN }} - name: JRE 11 id: jre - version_pattern: "11(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + version_pattern: "^11(?:\\.[\\d]+(?:\\.[\\d]+)?)?" cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main with: @@ -66,7 +66,7 @@ dependencies: token: ${{ secrets.JAVA_GITHUB_TOKEN }} - name: JDK 17 id: jdk - version_pattern: "17(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + version_pattern: "^17(?:\\.[\\d]+(?:\\.[\\d]+)?)?" cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main with: @@ -77,7 +77,7 @@ dependencies: token: ${{ secrets.JAVA_GITHUB_TOKEN }} - name: JRE 17 id: jre - version_pattern: "17(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + version_pattern: "^17(?:\\.[\\d]+(?:\\.[\\d]+)?)?" cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main with: @@ -86,26 +86,3 @@ dependencies: repository: semeru17-binaries tag_filter: jdk(.*17.*) token: ${{ secrets.JAVA_GITHUB_TOKEN }} -- name: JDK 18 - id: jdk - version_pattern: "18(?:\\.[\\d]+(?:\\.[\\d]+)?)?" - cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" - uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main - with: - glob: ibm-semeru-open-jdk_x64_linux_.+_openj9-.+.tar.gz - owner: ibmruntimes - repository: semeru18-binaries - tag_filter: jdk(.*18.*) - token: ${{ secrets.JAVA_GITHUB_TOKEN }} -- name: JRE 18 - id: jre - version_pattern: "18(?:\\.[\\d]+(?:\\.[\\d]+)?)?" - cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" - uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main - with: - glob: ibm-semeru-open-jre_x64_linux_.+_openj9-.+.tar.gz - owner: ibmruntimes - repository: semeru18-binaries - tag_filter: jdk(.*18.*) - token: ${{ secrets.JAVA_GITHUB_TOKEN }} - diff --git a/.github/workflows/pb-update-jdk-11.yml b/.github/workflows/pb-update-jdk-11.yml index fa98eca..08becea 100644 --- a/.github/workflows/pb-update-jdk-11.yml +++ b/.github/workflows/pb-update-jdk-11.yml @@ -97,7 +97,7 @@ jobs: SHA256: ${{ steps.dependency.outputs.sha256 }} URI: ${{ steps.dependency.outputs.uri }} VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: 11(?:\.[\d]+(?:\.[\d]+)?)? + VERSION_PATTERN: ^11(?:\.[\d]+(?:\.[\d]+)?)? - uses: peter-evans/create-pull-request@v4 with: author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> diff --git a/.github/workflows/pb-update-jdk-17.yml b/.github/workflows/pb-update-jdk-17.yml index 728970e..5c0759e 100644 --- a/.github/workflows/pb-update-jdk-17.yml +++ b/.github/workflows/pb-update-jdk-17.yml @@ -97,7 +97,7 @@ jobs: SHA256: ${{ steps.dependency.outputs.sha256 }} URI: ${{ steps.dependency.outputs.uri }} VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: 17(?:\.[\d]+(?:\.[\d]+)?)? + VERSION_PATTERN: ^17(?:\.[\d]+(?:\.[\d]+)?)? - uses: peter-evans/create-pull-request@v4 with: author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> diff --git a/.github/workflows/pb-update-jdk-18.yml b/.github/workflows/pb-update-jdk-18.yml deleted file mode 100644 index ed44b9a..0000000 --- a/.github/workflows/pb-update-jdk-18.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Update JDK 18 -"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/ibm-semeru-dependency:main - with: - glob: ibm-semeru-open-jdk_x64_linux_.+_openj9-.+.tar.gz - owner: ibmruntimes - repository: semeru18-binaries - tag_filter: jdk(.*18.*) - token: ${{ secrets.JAVA_GITHUB_TOKEN }} - - 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: '[\d]+\.[\d]+\.[\d]+' - ID: jdk - PURL: ${{ steps.dependency.outputs.purl }} - PURL_PATTERN: "" - SHA256: ${{ steps.dependency.outputs.sha256 }} - URI: ${{ steps.dependency.outputs.uri }} - VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: 18(?:\.[\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 `JDK 18` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. - branch: update/buildpack/jdk-18 - commit-message: |- - Bump JDK 18 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - - Bumps JDK 18 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 JDK 18 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - token: ${{ secrets.JAVA_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jre-11.yml b/.github/workflows/pb-update-jre-11.yml index 44f0a9c..78595f7 100644 --- a/.github/workflows/pb-update-jre-11.yml +++ b/.github/workflows/pb-update-jre-11.yml @@ -97,7 +97,7 @@ jobs: SHA256: ${{ steps.dependency.outputs.sha256 }} URI: ${{ steps.dependency.outputs.uri }} VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: 11(?:\.[\d]+(?:\.[\d]+)?)? + VERSION_PATTERN: ^11(?:\.[\d]+(?:\.[\d]+)?)? - uses: peter-evans/create-pull-request@v4 with: author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> diff --git a/.github/workflows/pb-update-jre-17.yml b/.github/workflows/pb-update-jre-17.yml index 6f3465a..cf0971c 100644 --- a/.github/workflows/pb-update-jre-17.yml +++ b/.github/workflows/pb-update-jre-17.yml @@ -97,7 +97,7 @@ jobs: SHA256: ${{ steps.dependency.outputs.sha256 }} URI: ${{ steps.dependency.outputs.uri }} VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: 17(?:\.[\d]+(?:\.[\d]+)?)? + VERSION_PATTERN: ^17(?:\.[\d]+(?:\.[\d]+)?)? - uses: peter-evans/create-pull-request@v4 with: author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> diff --git a/.github/workflows/pb-update-jre-18.yml b/.github/workflows/pb-update-jre-18.yml deleted file mode 100644 index 36a0cdb..0000000 --- a/.github/workflows/pb-update-jre-18.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Update JRE 18 -"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/ibm-semeru-dependency:main - with: - glob: ibm-semeru-open-jre_x64_linux_.+_openj9-.+.tar.gz - owner: ibmruntimes - repository: semeru18-binaries - tag_filter: jdk(.*18.*) - token: ${{ secrets.JAVA_GITHUB_TOKEN }} - - 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: '[\d]+\.[\d]+\.[\d]+' - ID: jre - PURL: ${{ steps.dependency.outputs.purl }} - PURL_PATTERN: "" - SHA256: ${{ steps.dependency.outputs.sha256 }} - URI: ${{ steps.dependency.outputs.uri }} - VERSION: ${{ steps.dependency.outputs.version }} - VERSION_PATTERN: 18(?:\.[\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 `JRE 18` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. - branch: update/buildpack/jre-18 - commit-message: |- - Bump JRE 18 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - - Bumps JRE 18 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 JRE 18 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} - token: ${{ secrets.JAVA_GITHUB_TOKEN }} diff --git a/.github/workflows/update-go.yml b/.github/workflows/update-go.yml new file mode 100644 index 0000000..0a77352 --- /dev/null +++ b/.github/workflows/update-go.yml @@ -0,0 +1,61 @@ +name: Update Go +"on": + schedule: + - cron: 0 2 * * 1 + workflow_dispatch: {} +jobs: + update: + name: Update Go + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v3 + with: + go-version: "1.18" + - uses: actions/checkout@v3 + - name: Update Go Version + id: update-go + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [ -z "${GO_VERSION:-}" ]; then + echo "No go version set" + exit 1 + fi + + OLD_GO_VERSION=$(grep -P '^go \d\.\d+' go.mod | cut -d ' ' -f 2) + + go mod edit -go="$GO_VERSION" + go mod tidy + go get -u all + go mod tidy + + git add go.mod go.sum + git checkout -- . + + echo "::set-output name=old-go-version::${OLD_GO_VERSION}" + echo "::set-output name=go-version::${GO_VERSION}" + env: + GO_VERSION: "1.18" + - uses: peter-evans/create-pull-request@v4 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: |- + Bumps Go from `${{ steps.update-go.outputs.old-go-version }}` to `${{ steps.update-go.outputs.go-version }}`. + +
+ Release Notes + ${{ steps.pipeline.outputs.release-notes }} +
+ branch: update/go + commit-message: |- + Bump Go from ${{ steps.update-go.outputs.old-go-version }} to ${{ steps.update-go.outputs.go-version }} + + Bumps Go from ${{ steps.update-go.outputs.old-go-version }} to ${{ steps.update-go.outputs.go-version }}. + delete-branch: true + labels: semver:minor, type:task + signoff: true + title: Bump Go from ${{ steps.update-go.outputs.old-go-version }} to ${{ steps.update-go.outputs.go-version }} + token: ${{ secrets.JAVA_GITHUB_TOKEN }}