Skip to content

Commit

Permalink
Release v0.8.0 (#55)
Browse files Browse the repository at this point in the history
* Add dart to path (#53)

* Make sure dart is actually available as a command

Added some basic acceptance testing to the final stages of the image
build to help us catch things like this in the future.

* Update CHANGELOG

* Upgrade release workflows (#54)

We can now use the re-usable create-release-pr action

* Ensure we tag the right commit that was released

* Release 0.8.0

* Trigger pre-release again

Co-authored-by: Matt Wynne <matt@cucumber.io>
  • Loading branch information
github-actions[bot] and mattwynne committed Aug 16, 2021
1 parent 58df71c commit 71a67e6
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 52 deletions.
43 changes: 6 additions & 37 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Pre-release

# Prepares a new releas
#
# To trigger it, simply change the CHANGELOG.md file, replacing the
# To trigger it, change the CHANGELOG.md file, replacing the
# "Unreleased" header text with the new release's version number.
#
# The workflow will automatically prepare a pull request for the release.
Expand Down Expand Up @@ -51,39 +51,8 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Create/update target branch for release, based on previous release
run: |
git checkout v${{ env.released_version }}
git checkout -b release/v${{ env.next_version }}
git push --force --set-upstream origin release/v${{ env.next_version }}
- name: Create/update a branch off `main` for the commit to be released
run: |
git checkout ${{ github.ref }}
git checkout -b pre-release/v${{ env.next_version }}
git push --force --set-upstream origin pre-release/v${{ env.next_version }}
- name: Check for existing PR for this release
id: pr-already-exists
run: |
output=$(gh pr list --base release/v${{ env.next_version }})
exists=$([[ $output == *"Release v${{ env.next_version }}"* ]] && echo "exists" || echo "")
echo "::set-output name=result::$exists"
- name: Create Pull Request
if: ${{ !steps.pr-already-exists.outputs.result }}
run: |
ref="${{ github.ref }}"
branch=${ref/refs\/heads\//}
cat >${{ runner.temp }}/body <<EOT
Auto-generated by the [pre-release.yaml](https://github.com/${{ github.repository }}/blob/main/.github/workflows/pre-release.yml) workflow, because the CHANGELOG.md
file contains a header for v${{ env.next_version }}.
The latest git tag is v${{ env.released_version }}, so it looks like a release is needed.
Review this PR carefully. When it's merged, the v${{ env.next_version }} release will happen automatically.
If you need to make changes to this release, just push more commits to the \`${branch}\` branch and this PR will be automatically updated.
EOT
gh pr create \
--base release/v${{ env.next_version }} \
--head pre-release/v${{ env.next_version }} \
--title "Release v${{ env.next_version }}" \
--body-file ${{ runner.temp }}/body
- uses: cucumber-actions/create-release-pr@v1.0.0
with:
released_version: ${{ env.released_version }}
next_version: ${{ env.next_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ jobs:
args: show ${{ env.version }}
- name: Create release
run: |
cat >${{ runner.temp }}/notes <<EOT
cat >${{ runner.temp }}/notes << "EOT"
${{ steps.release-notes.outputs.result }}
EOT
gh release create \
--notes-file ${{ runner.temp }}/notes \
--title v${{ env.version }} \
--target pre-release/v${{ env.version }} \
v${{ env.version }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
.local-image
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.8.0] - 2021-08-16
### Added
- Add dart to path ([#53](https://github.com/cucumber/build/pull/53))

## [0.7.0] - 2021-07-29
### Changed
- Update Perl dependencies ([#38](https://github.com/cucumber/build/pull/38))
Expand Down Expand Up @@ -51,7 +55,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Initial version

[Unreleased]: https://github.com/cucumber/build/compare/v0.7.0...HEAD
[Unreleased]: https://github.com/cucumber/build/compare/v0.8.0...HEAD
[0.8.0]: https://github.com/cucumber/build/compare/v0.7.0...0.8.0
[0.7.0]: https://github.com/cucumber/build/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/cucumber/build/compare/v0.5.2...v0.6.0
[0.5.2]: https://github.com/cucumber/build/compare/v0.5.1...v0.5.2
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ RUN apt-get update && apt-get install wget
COPY scripts/install-dart.sh .
RUN bash ./install-dart.sh
RUN rm ./install-dart.sh
ENV PATH="${PATH}:/usr/lib/dart-sdk/bin"

# Run some tests on the image
COPY scripts/acceptance-test-for-image.sh .
RUN bash ./acceptance-test-for-image.sh
RUN rm ./acceptance-test-for-image.sh

USER $USER

Expand Down
25 changes: 15 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
NAME := cucumber/cucumber-build
DEFAULT_PLATFORM = $(shell [ $$(arch) = "arm64" ] && echo "linux/arm64" || echo "linux/amd64")
PLATFORMS ?= ${DEFAULT_PLATFORM}
RUN_CMD ?=bash

default:
default: /tmp/.buildx-cache-new/index.json Dockerfile
.PHONY: default

/tmp/.buildx-cache-new/index.json: Dockerfile
docker buildx build \
--cache-to="type=local,dest=/tmp/.buildx-cache-new" \
--cache-from="type=local,src=/tmp/.buildx-cache" \
--platform=${PLATFORMS} \
--tag ${NAME}:latest .
.PHONY: default

local:
docker buildx build --platform=${PLATFORMS} --tag ${NAME}:latest --load .
local: /tmp/.buildx-cache-new/index.json .local-image
.PHONY: local

docker-push: default
echo "Deprecated. Please submit a pull request to the `release` branch to have your changes released."
.PHONY: docker-push

docker-run: local
docker run \
--volume "${HOME}/.m2/repository":/home/cukebot/.m2/repository \
--user 1000 \
--rm \
-it ${NAME} \
bash
.PHONY:
$(1)

.local-image:
docker buildx build --platform=${PLATFORMS} --tag ${NAME}:latest --load .
touch $@

clean:
rm .local-image
.PHONY: clean
7 changes: 7 additions & 0 deletions scripts/acceptance-test-for-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -e
#
# Runs some commands within the build image to validate basic expecations about what should be working.
#

which go || (echo "command 'go' not found" && exit 1)
which dart || (echo "command 'dart' not found" && exit 1)
3 changes: 0 additions & 3 deletions scripts/install-dart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,5 @@ unzip -d /usr/lib $tzip > /dev/null
chown -R cukebot /usr/lib/dart-sdk
chmod -R +rx /usr/lib/dart-sdk

# Adding dart to path
export PATH="$PATH:/usr/lib/dart-sdk/bin"

# Removing tmp files
rm -r "$tdir"

0 comments on commit 71a67e6

Please sign in to comment.