Skip to content
Closed
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
5 changes: 5 additions & 0 deletions .github/actions/check-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
39 changes: 28 additions & 11 deletions .github/actions/require-clean-working-directory/action.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,11 @@ jobs:
name: package-dist-${{ github.sha }}
# Glob discards the path before the first wildcard (`packages/`), so
# the artifact root is `<package>/dist/...`. Download into `packages/`
# to restore `packages/<package>/dist/...`.
path: packages/*/dist
# to restore `packages/<package>/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:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
stanleyyconsensys marked this conversation as resolved.
Dismissed
- 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
Expand Down Expand Up @@ -164,6 +191,7 @@ jobs:
- analyse-code
- check-release
- lint-build-test
- require-clean-release-pr
outputs:
passed: ${{ steps.set-output.outputs.passed }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
14 changes: 13 additions & 1 deletion packages/stellar-wallet-snap/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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
2 changes: 1 addition & 1 deletion packages/stellar-wallet-snap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/stellar-wallet-snap",
"version": "0.1.0",
"version": "0.2.0",
"description": "A Stellar wallet Snap",
"keywords": [
"Ethereum",
Expand Down
2 changes: 1 addition & 1 deletion packages/stellar-wallet-snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0",
"version": "0.2.0",
"description": "Manage Stellar using MetaMask",
"proposedName": "Stellar",
"repository": {
Expand Down
Loading