Skip to content

Commit

Permalink
Merge pull request #46 from paketo-buildpacks/update-pipelines
Browse files Browse the repository at this point in the history
Update Pipelines Workflow

Signed-off-by: Ben Hale <[email protected]>
  • Loading branch information
nebhale authored Nov 1, 2020
2 parents 0e38020 + e2b8fd3 commit 41818f5
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/pipeline-descriptor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
codeowners:
- path: "*"
owner: "@paketo-buildpacks/java-buildpacks"

package:
repository: gcr.io/paketo-buildpacks/amazon-corretto
register: true
registry_token: ${{ secrets.JAVA_BUILDPACK_REGISTRY_TOKEN }}

docker_credentials:
- registry: gcr.io
username: _json_key
password: ${{ secrets.JAVA_GCLOUD_SERVICE_ACCOUNT_KEY }}

dependencies:
- name: JDK 8
id: jdk
version_pattern: "8\\.[\\d]+\\.[\\d]+"
uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main
with:
glob: amazon-corretto-[\d.-]+-linux-x64.tar.gz
repository: corretto-8
- name: JDK 11
id: jdk
version_pattern: "11\\.[\\d]+\\.[\\d]+"
uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main
with:
glob: amazon-corretto-[\d.-]+-linux-x64.tar.gz
repository: corretto-11
- name: JDK 15
id: jdk
version_pattern: "15\\.[\\d]+\\.[\\d]+"
uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main
with:
glob: amazon-corretto-15\.[\d.-]+-linux-x64.tar.gz
repository: corretto-jdk
- id: jvmkill
uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main
with:
owner: cloudfoundry
repository: jvmkill
token: ${{ secrets.GITHUB_TOKEN }}
78 changes: 78 additions & 0 deletions .github/workflows/update-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Update Pipeline
"on":
schedule:
- cron: 0 5 * * 1-5
workflow_dispatch: {}
jobs:
update:
name: Update Pipeline
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.15"
- name: Install octo
run: |
#!/usr/bin/env bash
set -euo pipefail
GO111MODULE=on go get -u -ldflags="-s -w" github.com/paketo-buildpacks/pipeline-builder/cmd/octo
- id: pipeline
name: Update Pipeline
run: |
#!/usr/bin/env bash
set -euo pipefail
if [[ -f .github/pipeline-version ]]; then
OLD_VERSION=$(cat .github/pipeline-version)
else
OLD_VERSION="0.0.0"
fi
octo --descriptor "${DESCRIPTOR}"
PAYLOAD=$(gh api /repos/paketo-buildpacks/pipeline-builder/releases/latest)
NEW_VERSION=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.name')
echo "${NEW_VERSION}" > .github/pipeline-version
RELEASE_NOTES=$(
gh api \
-F text="$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.body')" \
-F mode="gfm" \
-F context="paketo-buildpacks/pipeline-builder" \
-X POST /markdown
)
git add .github/
git checkout -- .
echo "::set-output name=old-version::${OLD_VERSION}"
echo "::set-output name=new-version::${NEW_VERSION}"
echo "::set-output name=release-notes::${RELEASE_NOTES//$'\n'/%0A}"
env:
DESCRIPTOR: .github/pipeline-descriptor.yml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: peter-evans/create-pull-request@v3
with:
body: |-
Bumps pipeline from `${{ steps.pipeline.outputs.old-version }}` to `${{ steps.pipeline.outputs.new-version }}`.
<details>
<summary>Release Notes</summary>
${{ steps.pipeline.outputs.release-notes }}
</details>
branch: update/pipeline
commit-message: |-
Bump pipeline from ${{ steps.pipeline.outputs.old-version }} to ${{ steps.pipeline.outputs.new-version }}
Bumps pipeline from ${{ steps.pipeline.outputs.old-version }} to ${{ steps.pipeline.outputs.new-version }}.
delete-branch: true
labels: semver:patch, type:task
signoff: true
title: Bump pipeline from ${{ steps.pipeline.outputs.old-version }} to ${{ steps.pipeline.outputs.new-version }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 41818f5

Please sign in to comment.