Skip to content

Commit

Permalink
Update pipelines (#168)
Browse files Browse the repository at this point in the history
- Updates to most recent pipeline-builder version
- Updates pipelines to use Go 1.18
- Updates pipelines to use 'go install' instead of 'go get'
- Adds a pipeline to check for and update Go versions & to check for transitive go.mod updates, which dependabot does not do

Signed-off-by: Daniel Mikusa <[email protected]>

Signed-off-by: Daniel Mikusa <[email protected]>
Co-authored-by: Sambhav Kothari <[email protected]>
  • Loading branch information
Daniel Mikusa and sambhav authored Aug 19, 2022
1 parent 6305526 commit 25ba7f6
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/pipeline-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.2
1.25.2
1 change: 0 additions & 1 deletion .github/pipelines-version

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
- uses: mheap/github-action-required-labels@v2
with:
count: 1
labels: semver:major, semver:minor, semver:patch
Expand All @@ -22,7 +22,7 @@ jobs:
runs-on:
- ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
- uses: mheap/github-action-required-labels@v2
with:
count: 1
labels: type:bug, type:dependency-upgrade, type:documentation, type:enhancement, type:question, type:task
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Synchronize Labels
"on":
push:
branches:
- main
- release-1.x
paths:
- .github/labels.yml
jobs:
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/tests.yml → .github/workflows/pb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Tests
pull_request: {}
push:
branches:
- main
- release-1.x
jobs:
unit:
name: Unit Test
Expand All @@ -18,14 +18,26 @@ jobs:
restore-keys: ${{ runner.os }}-go-
- uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"
- name: Install richgo
run: |
#!/usr/bin/env bash
set -euo pipefail
GO111MODULE=on go get -u -ldflags="-s -w" github.com/kyoh86/richgo
echo "Installing richgo ${RICHGO_VERSION}"
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl \
--location \
--show-error \
--silent \
"https://github.com/kyoh86/richgo/releases/download/v${RICHGO_VERSION}/richgo_${RICHGO_VERSION}_linux_amd64.tar.gz" \
| tar -C "${HOME}"/bin -xz richgo
env:
RICHGO_VERSION: 0.3.10
- name: Run Tests
run: |
#!/usr/bin/env bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Draft Release
"on":
push:
branches:
- main
- release-1.x
jobs:
update:
name: Update Draft Release
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/pb-update-go.yml
Original file line number Diff line number Diff line change
@@ -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.IMPLEMENTATION_GITHUB_USERNAME }} <${{ secrets.IMPLEMENTATION_GITHUB_USERNAME }}@users.noreply.github.com>
body: |-
Bumps Go from `${{ steps.update-go.outputs.old-go-version }}` to `${{ steps.update-go.outputs.go-version }}`.
<details>
<summary>Release Notes</summary>
${{ steps.pipeline.outputs.release-notes }}
</details>
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.IMPLEMENTATION_GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Pipeline
"on":
push:
branches:
- main
- release-1.x
paths:
- .github/pipeline-descriptor.yml
schedule:
Expand All @@ -16,14 +16,14 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"
- 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
go install -ldflags="-s -w" github.com/paketo-buildpacks/pipeline-builder/cmd/octo@latest
- uses: actions/checkout@v3
- name: Update Pipeline
id: pipeline
Expand All @@ -38,6 +38,7 @@ jobs:
OLD_VERSION="0.0.0"
fi
rm .github/workflows/pb-*.yml || true
octo --descriptor "${DESCRIPTOR}"
PAYLOAD=$(gh api /repos/paketo-buildpacks/pipeline-builder/releases/latest)
Expand Down

0 comments on commit 25ba7f6

Please sign in to comment.