Skip to content

Commit

Permalink
Small improvements to the release notes template & check release work…
Browse files Browse the repository at this point in the history
…flow (#1178)

* Update release notes template

Signed-off-by: Natalie Arellano <[email protected]>

* Update test on fork script

Signed-off-by: Natalie Arellano <[email protected]>

* Fix

Signed-off-by: Natalie Arellano <[email protected]>

* Update check-latest-release to ignore pre-releases

Signed-off-by: Natalie Arellano <[email protected]>

---------

Signed-off-by: Natalie Arellano <[email protected]>
  • Loading branch information
natalieparellano authored Aug 10, 2023
1 parent c399865 commit 56083d0
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 16 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Set up go
- name: Setup go
uses: actions/setup-go@v4
with:
check-latest: true
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Set up go
- name: Setup go
uses: actions/setup-go@v4
with:
check-latest: true
Expand All @@ -65,7 +65,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Set up go
- name: Setup go
uses: actions/setup-go@v4
with:
check-latest: true
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history for all branches and tags
- name: Set up go
- name: Setup go
uses: actions/setup-go@v4
with:
check-latest: true
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
path: 'pack'
ref: 'main'
fetch-depth: 0 # fetch all history for all branches and tags
- name: Set up go
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.20.5'
Expand Down Expand Up @@ -293,7 +293,7 @@ jobs:
path: 'pack'
ref: 'main'
fetch-depth: 0 # fetch all history for all branches and tags
- name: Set up go
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.20.5'
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/check-latest-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check latest lifecycle release
name: check-latest-release

on:
schedule:
Expand All @@ -15,6 +15,19 @@ jobs:
with:
check-latest: true
go-version-file: 'go.mod'
- name: Get previous release tag
id: get-previous-release-tag
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
return github.rest.repos.getLatestRelease({
owner: "buildpacks",
repo: "lifecycle",
}).then(result => {
return result.data.tag_name
})
- name: Read go and release versions
id: read-versions
env:
Expand All @@ -26,7 +39,7 @@ jobs:
LATEST_GO_VERSION=$(go version | cut -d ' ' -f 3)
LATEST_RELEASE_VERSION=$(gh release list -L 1 | cut -d $'\t' -f 1 | cut -d ' ' -f 2)
LATEST_RELEASE_VERSION=${{ steps.get-previous-release-tag.outputs.result }}
wget https://github.com/buildpacks/lifecycle/releases/download/$LATEST_RELEASE_VERSION/lifecycle-$LATEST_RELEASE_VERSION+linux.x86-64.tgz -O lifecycle.tgz
tar xzf lifecycle.tgz
Expand Down
57 changes: 51 additions & 6 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
exit 1
fi
echo "LIFECYCLE_VERSION=$version" >> $GITHUB_ENV
- name: Determine download urls for linux-x86-64, linux-arm64 and windows
- name: Determine download urls for linux-x86-64, linux-arm64, and windows
id: artifact-urls
uses: actions/[email protected]
with:
Expand Down Expand Up @@ -111,26 +111,71 @@ jobs:
if: "!contains(env.LIFECYCLE_VERSION, 'rc') && !contains(env.LIFECYCLE_VERSION, 'pre')"
run: |
echo "RELEASE_KIND=release" >> $GITHUB_ENV
- name: Get previous release tag
id: get-previous-release-tag
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
return github.rest.repos.getLatestRelease({
owner: "buildpacks",
repo: "lifecycle",
}).then(result => {
return result.data.tag_name
})
- name: Setup go
uses: actions/setup-go@v4
with:
check-latest: true
- name: Get go version
id: get-go-version
run: |
mkdir tmp
tar xzvf ${{ env.ARTIFACTS_PATH }}/lifecycle-v${{ env.LIFECYCLE_VERSION }}+linux.x86-64.tgz -C tmp/
echo "GO_VERSION=$(go version tmp/lifecycle/lifecycle | cut -d ' ' -f 2 | sed -e 's/^go//')" >> $GITHUB_ENV
- name: Set release body text
run: |
cat << EOF > body.txt
# lifecycle v${{ env.LIFECYCLE_VERSION }}
Welcome to v${{ env.LIFECYCLE_VERSION }}, a **beta** ${{ env.RELEASE_KIND }} of the Cloud Native Buildpacks Lifecycle.
Welcome to v${{ env.LIFECYCLE_VERSION }}, a ${{ env.RELEASE_KIND }} of the Cloud Native Buildpacks Lifecycle.
## Prerequisites
The lifecycle runs as a normal user in a series of unprivileged containers. To export images and cache image layers, it requires access to a Docker daemon **or** Docker registry.
The lifecycle runs as a normal user in a series of unprivileged containers. To export images and cache image layers, it requires access to a Docker (compatible) daemon **or** an OCI registry.
## Install
Extract the .tgz file and copy the lifecycle binaries into a [build stack base image](https://github.com/buildpack/spec/blob/master/platform.md#stacks). The build image can then be orchestrated by a platform implementation such as the [pack CLI](https://github.com/buildpack/pack) or [tekton](https://github.com/tektoncd/catalog/blob/master/task/buildpacks/0.1/README.md).
Extract the .tgz file and copy the lifecycle binaries into a [build image](https://github.com/buildpacks/spec/blob/main/platform.md#build-image). The build image can then be orchestrated by a platform implementation such as the [pack CLI](https://github.com/buildpack/pack) or [tekton](https://github.com/tektoncd/catalog/tree/main/task/buildpacks).
## Lifecycle Image
An OCI image containing the lifecycle binaries is available at buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }}.
## Features
* TODO
* Updates go to version ${{ env.GO_VERSION }}
## Bugfixes
* TODO
## Chores
* TODO
**Full Changelog**: https://github.com/buildpacks/lifecycle/compare/${{ steps.get-previous-release-tag.outputs.result }}...release/${{ env.LIFECYCLE_VERSION }}
## Contributors
We'd like to acknowledge that this release wouldn't be as good without the help of the following amazing contributors:
TODO
EOF
- name: Create Pre Release
- name: Create pre-release
if: "contains(env.LIFECYCLE_VERSION, 'rc') || contains(env.LIFECYCLE_VERSION, 'pre')" # e.g., 0.99.0-rc.1
run: |
cd ${{ env.ARTIFACTS_PATH }}
Expand All @@ -143,7 +188,7 @@ jobs:
--title "lifecycle v${{ env.LIFECYCLE_VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
- name: Create release
if: "!contains(env.LIFECYCLE_VERSION, 'rc') && !contains(env.LIFECYCLE_VERSION, 'pre')"
run: |
cd ${{ env.ARTIFACTS_PATH }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up go
- name: Setup go
uses: actions/setup-go@v4
with:
check-latest: true
Expand Down
2 changes: 1 addition & 1 deletion tools/test-fork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo "Using public key from fork (assumes base-64 encoded COSIGN_PRIVATE_KEY and
cp $2 cosign.pub

echo "Removing arm tests (these require a self-hosted runner)"
sed -i '' "/test-linux-arm64:/,+11d" .github/workflows/build.yml
sed -i '' "/test-linux-arm64:/,+14d" .github/workflows/build.yml
sed -i '' "/test-linux-arm64/d" .github/workflows/build.yml

if [[ -z $3 ]]; then
Expand Down

0 comments on commit 56083d0

Please sign in to comment.