Skip to content

Commit

Permalink
Release v0.6.0 (#44)
Browse files Browse the repository at this point in the history
* Release v0.5.1 (#32)

* Release v0.5.2

* Add Dart (#36)

* Add Dart installation to main image
* Update changelog

Used an adapted version of the script from dart-lang/sdk#26953 (comment) to work on x64 and arm64 architectures.

* use nodejs 14 (#37)

* use nodejs 14

* Update CHANGELOG.md

* Added a pre-release workflow

This workflow is designed to automatically create a PR to the release
branch when the CHANGELOG is updated.

* Release 0.6.0

* try something else

* Revert "Release 0.6.0"

This reverts commit 57f341d.

* Release 0.6.0

* Try checking out release first

* Revert "Release 0.6.0"

This reverts commit 4d106cf.

* Fix yaml syntax

* Release 0.6.0

* Try as separate commands

* Revert "Release 0.6.0"

This reverts commit 16c6789.

* Release 0.6.0

* Revert "Release 0.6.0"

This reverts commit 5f8b1da.

* Release 0.6.0

* Try not committing the release stuff to main yet.

We can merge it back down to main once the release is done.

* Revert "Release 0.6.0"

This reverts commit a9dc1b6.

* Use a different branch naming strategy

* Try using release branch again

* Follow the steps in the README to create the branch

* Also checkout main

* Use proper ref for main

* Try git commands by hand

* Name the committer

* Correct name for branch

* I think we can let the GH action do the commit

* Push the new branch?

* Better push

* Fix typo

* Fix bad merge

* Let PR action create branch

* Read current release version from git tags

* Fetch tags

* Better job name

* Repair changelog - 0.6.0 has not been released yet!

* Try to trigger pre-release for 0.6.0 again

* Trigger pre-release

* Tweak working in release PR

Co-authored-by: Aurélien Reeves <aurelien.reeves@smartbear.com>
Co-authored-by: David Goss <david@davidgoss.co>
Co-authored-by: Matt Wynne <matt@cucumber.io>
Co-authored-by: mattwynne <mattwynne@users.noreply.github.com>
  • Loading branch information
5 people committed Jul 28, 2021
1 parent e2dc111 commit 9f57a1b
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 19 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Pre-release

# Prepares a new release of the build image.
#
# To trigger it, simply change the CHANGELOG.md file, replacing the
# "Unreleased" header with the header with the new release's
# version number.
#
# The workflow will automatically prepare a pull request to the `release` branch.
#

on:
push:
branches: [main]

jobs:

versions:
runs-on: ubuntu-latest
name: Get version numbers
outputs:
released-version: ${{ steps.current-release.outputs.result }}
next-version: ${{ steps.next-release.outputs.output }}
steps:
- uses: actions/checkout@v2
- name: read the current release version from git tags
id: current-release
run: |
git fetch --tags
version_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
version=${version_tag/v/}
echo "::set-output name=result::$version"
- name: read latest version from the changelog
id: next-release
uses: mattwynne/changelog-action@v1.2
with:
args: latest

create-release-pr:
runs-on: ubuntu-latest
name: Create / Update Release PR
needs: versions
if: needs.versions.outputs.released-version != needs.versions.outputs.next-version
env:
next_version: ${{ needs.versions.outputs.next-version }}
released_version: ${{ needs.versions.outputs.released-version }}
steps:
- uses: actions/checkout@v2
with:
ref: release
- run: git fetch origin main
- run: git checkout main
- run: git checkout release
- run: git rebase main
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
base: release
branch: pre-release/${{ env.next_version }}
title: "Release v${{ env.next_version }}"
body: |
Auto-generated by the [pre-release.yaml](https://github.com/cucumber/build/blob/main/.github/workflows/pre-release.yaml) 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.
team-reviewers: "@cucumber/build"
12 changes: 8 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ name: Release

on:
push:
branches: [release]

env:
version: 0.5.2
branches: [release*]

jobs:
docker-build:
Expand All @@ -15,6 +12,13 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Read version to release from the changelog
id: next-release
uses: mattwynne/changelog-action@v1.2
with:
args: latest
- name: Set version environment variable
run: echo "version"=${{ steps.next-release.outputs.output }} > $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand Down
48 changes: 34 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,56 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.2]
## [Unreleased]

## [0.6.0] - 2021-07-28
### Added
- Add Dart [#36](https://github.com/cucumber/build/pull/36)

### Changed
- Bump Node version from 12.22.1 to 14.17.3 [#37](https://github.com/cucumber/build/pull/37)

## [0.5.2]
### Changed
- Bump Node version from 12.16.2 to 12.22.1 [#33](https://github.com/cucumber/build/pull/33)

## [0.5.1]

### Fixed
- Add symlink for `chromium-browser` [#31](https://github.com/cucumber/cucumber-build/pull/31)

## [0.5.0]

### Removed
- Remove Mono [#28](https://github.com/cucumber/cucumber-build/pull/28)

## [0.4.4]

### Added
- Provide a multi-arch image (amd64 and arm64) to allow for Apple M1 silicon [#11](https://github.com/cucumber/cucumber-build/issues/11)

### Changed
- Check hash of all dependencies installed via curl/wget [#14](https://github.com/cucumber/cucumber-build/issues/14)

## [0.3.0]

### Changed
- Change Dockerfile to install .NET 5 SDK - [#19](https://github.com/cucumber/cucumber-build/pull/19)
- Switched to use Docker buildx

## [0.2.0]

Experimental arm64 build

## [0.1.0]

Initial version

## [0.2.0] - 2021-05-03
### Added
- Experimental arm64 build

## [0.1.0] - 2021-07-21
### Added
- Initial version

[Unreleased]: https://github.com/cucumber/build/compare/v0.6.0...HEAD
[0.6.0]: https://github.com/cucumber/build/compare/v0.6.0...0.6.0
[0.5.2]: https://github.com/cucumber/build/compare/0.5.1...0.5.2
[0.5.1]: https://github.com/cucumber/build/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/cucumber/build/compare/0.4.4...0.5.0
[0.4.4]: https://github.com/cucumber/build/compare/0.3.0...0.4.4
[0.3.0]: https://github.com/cucumber/build/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/cucumber/build/compare/0.1.0...0.2.0
[0.1.0]: https://github.com/cucumber/build/compare/8680f...0.1.0
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ RUN apt-get update \
# Download and install chromium for puppetteer
COPY scripts/download-chrome.sh .
RUN bash ./download-chrome.sh
RUN rm ./download-chrome.sh

# Puppetteer seems to need the binary to be called chromium-browser
RUN ln -s /usr/bin/chromium /usr/bin/chromium-browser

Expand All @@ -197,6 +199,12 @@ RUN curl -sSL https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
&& rm -rf /var/lib/apt/lists/* \
&& rm -f erlang.deb

# Install Dart
RUN apt-get update && apt-get install wget
COPY scripts/install-dart.sh .
RUN bash ./install-dart.sh
RUN rm ./install-dart.sh

USER $USER

## As a user install node and npm via node version-manager
Expand All @@ -207,7 +215,7 @@ RUN curl -sSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh -o
&& export NVM_DIR="$HOME/.nvm" \
&& [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \
&& [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" \
&& nvm install 12.22.1 \
&& nvm install 14.17.3 \
&& nvm install-latest-npm \
&& rm install-nvm.sh
WORKDIR /app
Expand Down
39 changes: 39 additions & 0 deletions scripts/install-dart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
set -e

# arm or intel?
arch=$([ "$TARGETARCH" == "amd64" ] && echo "x64" || echo $TARGETARCH)

# Creating temp file
tdir=$(mktemp -d -t dart.XXX)
zip="dartsdk-linux-$arch-release.zip"
sha="dartsdk-linux-$arch-release.zip.sha256sum"
tzip="$tdir/$zip"
tsha="$tdir/$sha"

# Downloading latest stable dist
wget -qO "$tzip" "https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/$zip"
wget -qO "$tsha" "https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/$sha"

chmod -R +rwx $tdir
cd $tdir
cat $tsha | sha256sum -c > /dev/null

# Check if checksum matched
if ! [ $? -eq 0 ]; then
>&2 echo "ERROR: SHA-256 checksum not matching"
rm -r "$tdir"
exit 1
fi

# Unzipping to lib location
unzip -d /usr/lib $tzip > /dev/null

# Enabling write and execution for the dark-sdk folder
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 9f57a1b

Please sign in to comment.