Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto release on vnext #5426

Merged
merged 9 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/big-points-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@ignored/hardhat-vnext-core": major
"@ignored/hardhat-vnext": major
"@ignored/hardhat-vnext-errors": major
"@ignored/hardhat-vnext-node-test-reporter": major
"@ignored/hardhat-vnext-utils": major
"@ignored/hardhat-vnext-zod-utils": major
---

First release on 3.0.0 pre-release
25 changes: 21 additions & 4 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"changelog": false,
"commit": false,
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "minor",
"ignore": ["@nomiclabs/common"],
"baseBranch": "v-next",
"updateInternalDependencies": "patch",
"ignore": [
"@nomiclabs/common",
"@nomicfoundation/hardhat-chai-matchers",
"hardhat",
"@nomicfoundation/hardhat-ethers",
"@nomicfoundation/hardhat-foundry",
"@nomicfoundation/hardhat-ledger",
"@nomicfoundation/hardhat-network-helpers",
"hardhat-shorthand",
"@nomicfoundation/hardhat-toolbox",
"@nomicfoundation/hardhat-toolbox-viem",
"@nomicfoundation/hardhat-verify",
"@nomicfoundation/hardhat-viem",
"@nomiclabs/hardhat-vyper",
"@nomicfoundation/hardhat-web3-v4",
"@nomicfoundation/example-project",
"@nomicfoundation/template-package"
],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
Expand Down
32 changes: 32 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@nomiclabs/common": "0.0.1",
"@nomicfoundation/eslint-plugin-hardhat-internal-rules": "1.0.2",
"@nomicfoundation/eslint-plugin-slow-imports": "1.0.0",
"@nomicfoundation/hardhat-chai-matchers": "2.0.6",
"hardhat": "2.22.4",
"@nomicfoundation/hardhat-ethers": "3.0.6",
"@nomicfoundation/hardhat-foundry": "1.1.2",
"@nomicfoundation/hardhat-ledger": "1.0.3",
"@nomicfoundation/hardhat-network-helpers": "1.0.10",
"hardhat-shorthand": "1.0.0",
"@nomicfoundation/hardhat-toolbox": "5.0.0",
"@nomicfoundation/hardhat-toolbox-viem": "3.0.0",
"@nomicfoundation/hardhat-verify": "2.0.7",
"@nomicfoundation/hardhat-viem": "2.0.2",
"@nomiclabs/hardhat-vyper": "3.0.6",
"@nomicfoundation/hardhat-web3-v4": "1.0.0",
"@ignored/hardhat-vnext-core": "2.0.0",
"@nomicfoundation/example-project": "3.0.0",
"@ignored/hardhat-vnext": "2.0.0",
"@ignored/hardhat-vnext-build-system": "2.0.0",
"@ignored/hardhat-vnext-errors": "2.0.0",
"@ignored/hardhat-vnext-node-test-reporter": "2.0.0",
"@ignored/hardhat-vnext-utils": "2.0.0",
"@ignored/hardhat-vnext-zod-utils": "2.0.0",
"@nomicfoundation/template-package": "3.0.0"
},
"changesets": []
}
5 changes: 0 additions & 5 deletions .changeset/seven-tips-float.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/wise-cheetahs-confess.md

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/v-next-changesets-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Changesets
on:
push:
branches:
- v-next

jobs:
changesetcheck:
name: Changeset Check
runs-on: ubuntu-latest
outputs:
CHANGESETS: ${{ steps.changesetcheck.outputs.CHANGESETS }}
steps:
- name: checkout code repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install
run: pnpm install --no-frozen-lockfile
- name: Changeset Check
id: changesetcheck
run: |
pnpm changeset status --output=changes.json

if grep "\"releases\": \[\]," changes.json; then
echo "No changesets found."
echo "changesets=notfound" >> "$GITHUB_OUTPUT"
else
echo "Changesets found."
echo "changesets=found" >> "$GITHUB_OUTPUT"
fi

release-pre-check:
name: Release Pre-Check
runs-on: ubuntu-latest
needs: [changesetcheck]
if: needs.changesetcheck.outputs.CHANGESETS == 'found'
steps:
- name: checkout code repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install
run: pnpm install --no-frozen-lockfile
- name: Run full check (build, lint and test)
run: pnpm run vnext-full-check

release:
name: Release
runs-on: ubuntu-latest
needs: [release-pre-check]
permissions:
contents: write
id-token: write
steps:
- name: checkout code repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install
run: pnpm install --no-frozen-lockfile
- name: Apply and commit changesets
run: |
echo "Changesets found. Starting release."
pnpm changeset version
git config --global user.name "Github Actions"
git config --global user.email "[email protected]"
git commit -a -m "chore: v-next version bump"
# git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.VNEXT_NPM_TOKEN }}" > .npmrc
- name: Publish
run: pnpm publish --filter "./v-next/**" -r --no-git-checks --tag next --access public --dry-run
env:
NPM_CONFIG_PROVENANCE: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets us the provenance tag on npmjs.com

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"test": "node scripts/run-tests.js",
"lint": "pnpm run --recursive lint && pnpm prettier --check",
"lint:fix": "pnpm run --recursive lint:fix && pnpm prettier --write",
"prettier": "prettier *.md \"{docs,.github}/**/*.{md,yml,ts,js}\" \"scripts/**/*.js\""
"prettier": "prettier *.md \"{docs,.github}/**/*.{md,yml,ts,js}\" \"scripts/**/*.js\"",
"vnext-full-check": "pnpm run --recursive --filter \"./v-next/**\" build && pnpm run --recursive --filter \"./v-next/**\" lint && pnpm run --recursive --filter \"./v-next/**\" test"
},
"dependencies": {}
}
Loading