Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3625 from trufflesuite/develop
Browse files Browse the repository at this point in the history
chore(release): publish v7.4.2
  • Loading branch information
MicaiahReid committed Sep 7, 2022
2 parents 3a74e07 + 28ebab7 commit 04aee44
Show file tree
Hide file tree
Showing 55 changed files with 935 additions and 462 deletions.
73 changes: 73 additions & 0 deletions .github/actions/docker-publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Docker Publish"
description: "Builds and publishes a Docker image for the Ganache repo."
inputs:
VERSION:
description: "The release version to be tagged to the Docker image, e.g., 4.0.1"
required: true
TAG:
description: "The tag to be tagged to the Docker image, e.g., latest."
required: true
DOCKER_USERNAME:
description: "Username to log in to Docker hub."
required: true
DOCKER_ACCESS_TOKEN:
description: "Access token to log in to Docker hub."
required: true
GITHUB_TOKEN:
description: "Github token used to log in to the container registry."
required: true
INFURA_KEY:
description: "Infura key used to build Ganache within the Docker image."
required: true
runs:
# "composite" means we are using yml (rather than js or docker) for our action
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
using: "composite"
steps:
- name: Use npm 14
uses: actions/setup-node@v1
with:
node-version: 14

- name: Run installation
run: npm ci
shell: bash

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ inputs.DOCKER_USERNAME }}
password: ${{ inputs.DOCKER_ACCESS_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
trufflesuite/ganache
ghcr.io/${{ github.repository}}
- name: Set up QEMU
uses: docker/setup-qemu-action@0522dcd2bf084920c411162fde334a308be75015

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@91cb32d715c128e5f0ede915cd7e196ab7799b83

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: ./src/packages/ganache/Dockerfile
push: true
tags: ${{ format('trufflesuite/ganache:{0}, trufflesuite/ganache:v{1}', inputs.TAG, inputs.VERSION) }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64/v8,linux/amd64
build-args: |
INFURA_KEY=${{ inputs.INFURA_KEY }}
5 changes: 5 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# validates that the PR title has a semantic commit message; ignores commits
titleOnly: true
# custom URL for the "Details" link (which appears next to the success/failure
# message from the app) to be specified
targetUrl: "https://github.com/trufflesuite/ganache/blob/develop/CONTRIBUTING.md#pull-requests"
91 changes: 42 additions & 49 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
# this should match the os version used by the "check bundle size" step in
# pr.yml
runs-on: ubuntu-20.04
outputs:
TAG: ${{ steps.set_tag_output.outputs.TAG }}
VERSION: ${{ steps.set_version_output.outputs.VERSION }}
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -39,15 +42,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run installation
run: npm ci

- name: Test
run: npm test
env:
FORCE_COLOR: 1
INFURA_KEY: ${{ secrets.TEST_INFURA_KEY }}

- name: Set TAG for master to latest
if: ${{ github.ref == 'refs/heads/master' }}
run: |
Expand All @@ -58,6 +52,10 @@ jobs:
run: |
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set TAG as job output variable
id: set_tag_output
run: echo "::set-output name=TAG::${TAG}"

- name: Count features
if: ${{ env.TAG == 'latest'}}
# get all commits in develop that aren't in master, find any that start with feat: or feat(*):, then count them
Expand Down Expand Up @@ -94,6 +92,15 @@ jobs:
if: ${{ env.TAG == 'latest' && env.FEATURE_COUNT == '0' }}
run: echo "RELEASE_KIND=patch" >> $GITHUB_ENV

- name: Run installation
run: npm ci

- name: Test
run: npm test
env:
FORCE_COLOR: 1
INFURA_KEY: ${{ secrets.TEST_INFURA_KEY }}

- name: Update package versions for latest release (master)
if: ${{ env.TAG == 'latest' }}
run: $(npm bin)/lerna version "$RELEASE_KIND" --no-git-tag-version --no-push --yes --exact
Expand All @@ -119,6 +126,10 @@ jobs:
run: |
echo "VERSION=$(node -e 'console.log(require("./src/packages/ganache/package.json").version)')" >> $GITHUB_ENV
- name: Set VERSION as job output variable
id: set_version_output
run: echo "::set-output name=VERSION::${VERSION}"

- name: Commit all staged changes
run: |
git commit -m "chore(release): publish v${VERSION}" -m "ganache@${VERSION}"
Expand Down Expand Up @@ -149,49 +160,31 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# publish to docker and github packages
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
trufflesuite/ganache
ghcr.io/${{ github.repository}}
- name: Set up QEMU
uses: docker/setup-qemu-action@0522dcd2bf084920c411162fde334a308be75015

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@91cb32d715c128e5f0ede915cd7e196ab7799b83

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: ./src/packages/ganache/Dockerfile
push: true
tags: ${{ format('trufflesuite/ganache:{0}, trufflesuite/ganache:v{1}', env.TAG, env.VERSION) }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64/v8,linux/amd64
build-args: |
INFURA_KEY=${{ secrets.INFURA_KEY }}
- name: Merge changes back into develop for latest release (master)
if: ${{ env.TAG == 'latest' }}
run: |
git checkout develop
git merge origin/master
git push origin develop
publish-docker:
needs: release
runs-on: ubuntu-20.04
steps:
# because the docker publish action is an action we made, we have to
# check out the repo
- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Ganache's docker publish action
# we are running our local action, so point directly to a folder
# containing an `action.yml` file
uses: ./.github/actions/docker-publish
with:
VERSION: ${{ needs.release.outputs.VERSION }}
TAG: ${{ needs.release.outputs.TAG }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
INFURA_KEY: ${{ secrets.INFURA_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ find useful.

We _always_ "Squash and Merge" Pull Requests into a single commit message when merging into the `develop` branch.

The "Squash and Merge" commit message _must_ be in the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format:
The PR title and "Squash and Merge" commit message _must_ be in the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format. The [semantic-prs](https://github.com/Ezard/semantic-prs#readme) Github app is enabled for the repo and configured to require a PR title in the conventional commit format. When you "Squash and Merge", the commit message will automatically pull from the PR title, so just don't change this and there shouldn't be any issues. The conventional commit format is as follows:

```
<type>[optional scope]: <description> (#PR Number)
Expand Down
6 changes: 3 additions & 3 deletions src/chains/ethereum/address/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("@ganache/ethereum-address", () => {
const expected = Buffer.alloc(20);
expected[19] = 1;

assert.deepEqual(bufferAddress, expected);
assert.deepStrictEqual(bufferAddress, expected);
});

it("should truncate an address to the specified length", () => {
Expand All @@ -64,15 +64,15 @@ describe("@ganache/ethereum-address", () => {
0x21, 0x04, 0x85, 0x93, 0x94, 0x60, 0x43, 0x59, 0x37, 0x84, 0x33, 0x86,
0x53, 0x60, 0x94, 0x71, 0x16, 0x70, 0x78, 0x76
]);
assert.deepEqual(bufferAddress, expected);
assert.deepStrictEqual(bufferAddress, expected);
});

it("should pad an address to 20 bytes when called as static function", () => {
const bufferAddress = Address.toBuffer("0x1");
const expected = Buffer.alloc(20);
expected[19] = 1;

assert.deepEqual(bufferAddress, expected);
assert.deepStrictEqual(bufferAddress, expected);
});
});
});

0 comments on commit 04aee44

Please sign in to comment.