diff --git a/.github/actions/check-release/action.yml b/.github/actions/check-release/action.yml index cb85f57d5..4a28b0f75 100644 --- a/.github/actions/check-release/action.yml +++ b/.github/actions/check-release/action.yml @@ -6,6 +6,11 @@ inputs: description: "Validate that the release commit starts with a string in this comma-separated list. Use '[version]' to refer to the current release version." required: true +outputs: + IS_RELEASE_PR: + description: 'Whether this pull request is a release PR.' + value: ${{ steps.is-release.outputs.IS_RELEASE }} + runs: using: composite steps: diff --git a/.github/actions/require-clean-working-directory/action.yml b/.github/actions/require-clean-working-directory/action.yml index d5149b317..fdb9cd9c1 100644 --- a/.github/actions/require-clean-working-directory/action.yml +++ b/.github/actions/require-clean-working-directory/action.yml @@ -1,21 +1,38 @@ name: Require clean working directory description: Fail if the working tree is dirty, ignoring snap.manifest.json shasum-only drift. +inputs: + skip-shasum-diff: + description: 'Skip shasum-only diff check for snap.manifest.json' + required: false + default: true + runs: using: composite steps: - name: Require clean working directory shell: bash + env: + SKIP_SHASUM_DIFF: ${{ inputs.skip-shasum-diff }} run: | - # mm-snap rewrites source.shasum during yarn build. Ignore shasum-only - # drift so CI doesn't require restamping manifests after each build. - # Other manifest fields and all other files still fail the check. - # publish-release keeps a strict dirty check so npm publish stays valid. - if ! git diff --exit-code -- ':!packages/*/snap.manifest.json'; then - echo "Working tree dirty at end of job" - exit 1 - fi - if ! git diff --exit-code -I '"shasum":' -- 'packages/*/snap.manifest.json'; then - echo "Working tree dirty at end of job (non-shasum snap.manifest.json changes)" - exit 1 + if [[ "$SKIP_SHASUM_DIFF" == "true" ]]; then + echo "Skipping shasum-only diff check for snap.manifest.json" + + # mm-snap rewrites source.shasum during yarn build. Ignore shasum-only + # drift so CI doesn't require restamping manifests after each build. + # Other manifest fields and all other files still fail the check. + # publish-release keeps a strict dirty check so npm publish stays valid. + if ! git diff --exit-code -- ':!packages/*/snap.manifest.json'; then + echo "Working tree dirty at end of job" + exit 1 + fi + if ! git diff --exit-code -I '"shasum":' -- 'packages/*/snap.manifest.json'; then + echo "Working tree dirty at end of job (non-shasum snap.manifest.json changes)" + exit 1 + fi + else + if ! git diff --exit-code; then + echo "Working tree dirty at end of job" + exit 1 + fi fi diff --git a/.github/workflows/lint-build-test.yml b/.github/workflows/lint-build-test.yml index 7b8a879ee..afcffec2d 100644 --- a/.github/workflows/lint-build-test.yml +++ b/.github/workflows/lint-build-test.yml @@ -182,8 +182,11 @@ jobs: name: package-dist-${{ github.sha }} # Glob discards the path before the first wildcard (`packages/`), so # the artifact root is `/dist/...`. Download into `packages/` - # to restore `packages//dist/...`. - path: packages/*/dist + # to restore `packages//dist/...`. Include post-build + # manifests so require-clean-release-pr can run a strict dirty check. + path: | + packages/*/dist + packages/*/snap.manifest.json retention-days: 1 test-scripts: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a4f80b9b..044857985 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,15 +104,42 @@ jobs: permissions: contents: read pull-requests: write + outputs: + IS_RELEASE_PR: ${{ steps.check-release.outputs.IS_RELEASE_PR }} steps: - name: Checkout repository uses: actions/checkout@v7 - name: Check release + id: check-release if: github.event_name != 'push' uses: ./.github/actions/check-release with: commit-starts-with: ${{ vars.RELEASE_COMMIT_PREFIX }} + require-clean-release-pr: + name: Require clean working directory on release PR + needs: + - check-release + - lint-build-test + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout repository + if: needs.check-release.outputs.IS_RELEASE_PR == 'true' + uses: actions/checkout@v7 + - name: Restore build artifacts + if: needs.check-release.outputs.IS_RELEASE_PR == 'true' + uses: actions/download-artifact@v8 + with: + name: package-dist-${{ github.sha }} + path: packages + - name: Require clean working directory + if: needs.check-release.outputs.IS_RELEASE_PR == 'true' + uses: ./.github/actions/require-clean-working-directory + with: + skip-shasum-diff: false + is-release: name: Determine whether this is a release merge commit needs: lint-build-test @@ -164,6 +191,7 @@ jobs: - analyse-code - check-release - lint-build-test + - require-clean-release-pr outputs: passed: ${{ steps.set-output.outputs.passed }} steps: diff --git a/package.json b/package.json index 389acfa9e..bf25d39f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/internal-snaps-monorepo", - "version": "8.0.0", + "version": "9.0.0", "private": true, "description": "Monorepo for first-party snaps", "repository": { diff --git a/packages/stellar-wallet-snap/CHANGELOG.md b/packages/stellar-wallet-snap/CHANGELOG.md index 23fdc5a7d..df9e82e95 100644 --- a/packages/stellar-wallet-snap/CHANGELOG.md +++ b/packages/stellar-wallet-snap/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.0] + +### Uncategorized + +- feat: move batch utils into shared pkg ([#211](https://github.com/MetaMask/internal-snaps/pull/211)) +- feat(stellar-wallet-snap): use shareable permissions helpers in Stellar snap ([#212](https://github.com/MetaMask/internal-snaps/pull/212)) +- feat: move buildUrl into shared util pkg ([#195](https://github.com/MetaMask/internal-snaps/pull/195)) +- feat: move sanitize utils into shared pkg ([#191](https://github.com/MetaMask/internal-snaps/pull/191)) +- feat(stellar-wallet-snap): use shared safeMerge in Stellar snap ([#192](https://github.com/MetaMask/internal-snaps/pull/192)) +- feat(stellar-wallet-snap): use shared urlstruct ([#190](https://github.com/MetaMask/internal-snaps/pull/190)) + ### Added - Add `TrustlineExceedLimitException` for send simulation when a payment would exceed the destination trustline limit (previously a generic `TransactionValidationException`) ([#185](https://github.com/MetaMask/internal-snaps/pull/185)) @@ -23,5 +34,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial package release ([#181](https://github.com/MetaMask/internal-snaps/pull/181)) -[Unreleased]: https://github.com/MetaMask/internal-snaps/compare/@metamask/stellar-wallet-snap@0.1.0...HEAD +[Unreleased]: https://github.com/MetaMask/internal-snaps/compare/@metamask/stellar-wallet-snap@0.2.0...HEAD +[0.2.0]: https://github.com/MetaMask/internal-snaps/compare/@metamask/stellar-wallet-snap@0.1.0...@metamask/stellar-wallet-snap@0.2.0 [0.1.0]: https://github.com/MetaMask/internal-snaps/releases/tag/@metamask/stellar-wallet-snap@0.1.0 diff --git a/packages/stellar-wallet-snap/package.json b/packages/stellar-wallet-snap/package.json index 3fd217dfb..4ac4f4bc9 100644 --- a/packages/stellar-wallet-snap/package.json +++ b/packages/stellar-wallet-snap/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/stellar-wallet-snap", - "version": "0.1.0", + "version": "0.2.0", "description": "A Stellar wallet Snap", "keywords": [ "Ethereum", diff --git a/packages/stellar-wallet-snap/snap.manifest.json b/packages/stellar-wallet-snap/snap.manifest.json index 4c877cf20..fae72c6ab 100644 --- a/packages/stellar-wallet-snap/snap.manifest.json +++ b/packages/stellar-wallet-snap/snap.manifest.json @@ -1,5 +1,5 @@ { - "version": "0.1.0", + "version": "0.2.0", "description": "Manage Stellar using MetaMask", "proposedName": "Stellar", "repository": {