-
Notifications
You must be signed in to change notification settings - Fork 15
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 #79 from paketo-buildpacks/update-pipelines
Update Pipelines Workflow Signed-off-by: Ben Hale <bhale@vmware.com>
- Loading branch information
Showing
42 changed files
with
241 additions
and
907 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
descriptors/pipeline-builder.yml → .github/pipeline-descriptor.yml
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
path: ../ | ||
|
||
codeowners: | ||
- path: "*" | ||
owner: "@paketo-buildpacks/java-buildpacks" | ||
|
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,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 }} |
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.