Skip to content

Commit

Permalink
Merge pull request #626 from buildpacks/release-candidates
Browse files Browse the repository at this point in the history
Add GHA for shipping release candidates
  • Loading branch information
natalieparellano committed Jun 11, 2021
2 parents edbabee + 5dc5a88 commit 8e9b27e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
TEST_COVERAGE: 1
run: make test
- name: Upload Coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v1.0.5
with:
file: ./out/tests/coverage-unit.txt
flags: unit,os_linux
Expand Down
61 changes: 59 additions & 2 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ jobs:
fi
echo "LIFECYCLE_VERSION=$version" >> $GITHUB_ENV
shell: bash
- name: Compute short sha
run: |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Determine download urls for linux and windows
id: artifact-urls
uses: actions/github-script@v3.0.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
return github.actions
.listRepoWorkflows({
Expand Down Expand Up @@ -108,7 +111,55 @@ jobs:
unzip -d artifact-windows artifact-windows.zip
lifecycle_path=$(ls artifact-windows/lifecycle-*windows.x86-64.tgz)
echo "ARTIFACT_WINDOWS_PATH=$PWD/$lifecycle_path" >> $GITHUB_ENV
- name: Create Pre Release
if: contains(env.LIFECYCLE_VERSION, 'rc')
id: create_pre_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.LIFECYCLE_VERSION }}
release_name: lifecycle v${{ env.LIFECYCLE_VERSION }}
draft: true
prerelease: true
body: |
# lifecycle v${{ env.LIFECYCLE_VERSION }}
Welcome to `v${{ env.LIFECYCLE_VERSION }}`, a **beta** pre-release 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.
## 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).
## Lifecycle Image
An OCI image containing the lifecycle binaries is available at buildpacksio/lifecycle:${{ env.SHORT_SHA }}.
- name: Upload Pre Release Asset - linux
if: contains(env.LIFECYCLE_VERSION, 'rc')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_pre_release.outputs.upload_url }}
asset_path: ${{ env.ARTIFACT_LINUX_PATH }}
asset_name: lifecycle-v${{ env.LIFECYCLE_VERSION }}+linux.x86-64.tgz
asset_content_type: application/gzip
- name: Upload Pre Release Asset - windows
if: contains(env.LIFECYCLE_VERSION, 'rc')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_pre_release.outputs.upload_url }}
asset_path: ${{ env.ARTIFACT_WINDOWS_PATH }}
asset_name: lifecycle-v${{ env.LIFECYCLE_VERSION }}+windows.x86-64.tgz
asset_content_type: application/gzip
- name: Create Release
if: "!contains(env.LIFECYCLE_VERSION, 'rc')"
id: create_release
uses: actions/create-release@latest
env:
Expand All @@ -121,7 +172,7 @@ jobs:
body: |
# lifecycle v${{ env.LIFECYCLE_VERSION }}
Welcome to `v${{ env.LIFECYCLE_VERSION }}`, a **beta** release of the Cloud Native Buildpack Lifecycle.
Welcome to `v${{ env.LIFECYCLE_VERSION }}`, a **beta** release of the Cloud Native Buildpacks Lifecycle.
## Prerequisites
Expand All @@ -130,7 +181,12 @@ jobs:
## 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).
## Lifecycle Image
An OCI image containing the lifecycle binaries is available at buildpacksio/lifecycle:${{ env.LIFECYCLE_VERSION }}.
- name: Upload Release Asset - linux
if: "!contains(env.LIFECYCLE_VERSION, 'rc')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -140,6 +196,7 @@ jobs:
asset_name: lifecycle-v${{ env.LIFECYCLE_VERSION }}+linux.x86-64.tgz
asset_content_type: application/gzip
- name: Upload Release Asset - windows
if: "!contains(env.LIFECYCLE_VERSION, 'rc')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 @@ -3,7 +3,7 @@ name: post-release
on:
release:
types:
- published
- released # do not trigger for pre-releases

jobs:
retag-lifecycle-images-linux:
Expand Down
8 changes: 8 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Release Finalization

To cut a pre-release:
1. If applicable, ensure the README is updated with the latest supported apis (example PR: https://github.com/buildpacks/lifecycle/pull/550).
1. Create a release branch in the format `release/0.99.0-rc.1`. New commits to this branch will trigger the `build` workflow and produce a lifecycle image: `buildpacksio/lifecycle:<commit sha>`.
1. When ready to cut the release, manually trigger the `draft-release` workflow: Actions -> draft-release -> Run workflow -> Use workflow from branch: `release/0.99.0-rc.1`. This will create a draft release on GitHub using the artifacts from the `build` workflow run for the latest commit on the release branch.
1. Edit the release notes as necessary.
1. Perform any manual validation of the artifacts (see below).
1. When ready to publish the release, edit the release page and click "Publish release". Note that this will NOT trigger the `post-release` workflow (see below).

To cut a release:
1. Ensure the relevant spec APIs have been released.
1. Ensure any [migration guides](https://github.com/buildpacks/docs/tree/main/content/docs/reference/spec/migration) have been created.
Expand Down

0 comments on commit 8e9b27e

Please sign in to comment.