Skip to content

Commit

Permalink
chore: Release CD (#13)
Browse files Browse the repository at this point in the history
* update `pr.yml`

* implement release please

* small fixes

* fix `yarn.lock`

* address comments
  • Loading branch information
BeroBurny authored Jan 11, 2024
1 parent 6351819 commit 7d86f60
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 21 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release
on:
push:
branches:
- master
jobs:
maybe-release:
name: release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:

- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: master
release-type: node
monorepo-tags: true
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"revert","hidden":true}]'

- uses: actions/checkout@v3
if: ${{ steps.release.outputs.releases_created }}

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.releases_created }}

- run: corepack enable
if: ${{ steps.release.outputs.releases_created }}

- name: Get yarn cache directory path
if: ${{ steps.release.outputs.releases_created }}
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Yarn cache
if: ${{ steps.release.outputs.releases_created }}
id: yarn-cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache

- run: yarn install --immutable
if: ${{ steps.release.outputs.releases_created }}

- run: yarn build
if: ${{ steps.release.outputs.releases_created }}

- env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.releases_created }}
run: |
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml
- run: yarn workspaces foreach -v --exclude root --no-private npm publish --tolerate-republish --access public
if: ${{ steps.release.outputs.releases_created }}
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
name: 'ci / test'

on:
push:
branches:
- main # runs on push to master, add more branches if you use them
pull_request:
branches:
- '**' # runs on update to pull request on any branch

concurrency:
group: ci-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
# most basic test job
test:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- edited
- synchronize

concurrency:
group: pr-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
main:
name: Validate PR title
Expand All @@ -21,3 +25,7 @@ jobs:
feat
chore
revert
docs
refactor
test
perf
4 changes: 4 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"packages/plugin": "0.0.0",
"packages/contracts": "0.0.0"
}
6 changes: 5 additions & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "contracts",
"name": "@chainsafe/hardhat-plugin-multichain-deploy-contracts",
"version": "0.0.1",
"license": "MIT",
"files": [
"artifacts",
"contracts"
],
"scripts": {
"build": "hardhat compile",
"hardhat": "hardhat",
Expand Down
23 changes: 23 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"plugins": [],
"packages": {
"packages/plugin": {
"releaseType": "node",
"draft": false,
"prerelease": false,
"bumpMinorPreMajor": false,
"bumpPatchForMinorPreMajor": false,
"changelogPath": "CHANGELOG.md",
"versioning": "default"
},
"packages/contracts": {
"releaseType": "node",
"draft": false,
"prerelease": false,
"bumpMinorPreMajor": false,
"bumpPatchForMinorPreMajor": false,
"changelogPath": "CHANGELOG.md",
"versioning": "default"
}
}
}
40 changes: 20 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,26 @@ __metadata:
languageName: node
linkType: hard

"@chainsafe/hardhat-plugin-multichain-deploy-contracts@workspace:packages/contracts":
version: 0.0.0-use.local
resolution: "@chainsafe/hardhat-plugin-multichain-deploy-contracts@workspace:packages/contracts"
dependencies:
"@chainsafe/hardhat-ts-artifact-plugin": ^1.0.0
"@nomicfoundation/hardhat-network-helpers": ^1.0.0
"@nomicfoundation/hardhat-verify": ^2.0.0
"@nomicfoundation/hardhat-web3-v4": ^1.0.0
"@rushstack/eslint-patch": ^1.2.0
"@typechain/hardhat": ^9.0.0
chai: ^4.2.0
dotenv: ^16.3.1
hardhat: ^2.19.1
hardhat-docgen: ^1.3.0
hardhat-gas-reporter: ^1.0.8
solidity-coverage: ^0.8.0
web3: 4
languageName: unknown
linkType: soft

"@chainsafe/hardhat-plugin-multichain-deploy@workspace:packages/plugin":
version: 0.0.0-use.local
resolution: "@chainsafe/hardhat-plugin-multichain-deploy@workspace:packages/plugin"
Expand Down Expand Up @@ -4769,26 +4789,6 @@ __metadata:
languageName: node
linkType: hard

"contracts@workspace:packages/contracts":
version: 0.0.0-use.local
resolution: "contracts@workspace:packages/contracts"
dependencies:
"@chainsafe/hardhat-ts-artifact-plugin": ^1.0.0
"@nomicfoundation/hardhat-network-helpers": ^1.0.0
"@nomicfoundation/hardhat-verify": ^2.0.0
"@nomicfoundation/hardhat-web3-v4": ^1.0.0
"@rushstack/eslint-patch": ^1.2.0
"@typechain/hardhat": ^9.0.0
chai: ^4.2.0
dotenv: ^16.3.1
hardhat: ^2.19.1
hardhat-docgen: ^1.3.0
hardhat-gas-reporter: ^1.0.8
solidity-coverage: ^0.8.0
web3: 4
languageName: unknown
linkType: soft

"cookie-signature@npm:1.0.6":
version: 1.0.6
resolution: "cookie-signature@npm:1.0.6"
Expand Down

0 comments on commit 7d86f60

Please sign in to comment.