-
-
Notifications
You must be signed in to change notification settings - Fork 189
make @metamask/vault-decryptor site publishable #87
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
75b4cb9
6a063e6
47a36a1
e8f0613
d582297
0290553
ec94841
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Deploy to GitHub Pages using the dist/ folder from the build | ||
| name: Deploy to GitHub Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: '.nvmrc' | ||
| cache: 'yarn' | ||
| - name: Install Yarn dependencies | ||
| run: yarn --immutable | ||
| - name: Run build script | ||
| run: yarn build | ||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: dist | ||
|
|
||
| deploy: | ||
| name: Deploy | ||
| needs: build | ||
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
| permissions: | ||
| pages: write # to deploy to Pages | ||
| id-token: write # to verify the deployment originates from an appropriate source | ||
| # Deploy to the github-pages environment | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| node_modules/ | ||
| dist/ | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,17 @@ | ||
| { | ||
| "name": "@metamask/vault-decryptor", | ||
| "version": "1.0.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that this PR is not just about making the site publishable, we are also making the package public as well. Do we want to set this version to 0.0.0? Otherwise, when we make a PR to release the package, the version won't be changed (or maybe it will, but it might go from 1.0.0 to something 0.1.0 which would be strange).
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you very much! Updated version to 0.0.0 |
||
| "private": true, | ||
| "description": "Utility for decrypting MetaMask vault data", | ||
| "main": "index.js", | ||
| "files": [ | ||
| "dist" | ||
|
Unik0rnMaggie marked this conversation as resolved.
|
||
| ], | ||
|
Unik0rnMaggie marked this conversation as resolved.
|
||
| "scripts": { | ||
| "build": "mkdir -p dist && browserify index.js -o dist/bundle.js && cp index.html dist/", | ||
| "build:clean": "yarn clean && yarn build", | ||
| "clean": "rimraf dist", | ||
| "prepublishOnly": "yarn build", | ||
| "start": "beefy index.js:bundle.js --live --open", | ||
| "test": "jest && jest-it-up", | ||
| "build": "browserify index.js -o bundle.js" | ||
| "test": "jest && jest-it-up" | ||
| }, | ||
| "browserify": { | ||
| "transform": [ | ||
|
|
@@ -56,7 +60,8 @@ | |
| "brfs": "^1.4.3", | ||
| "browserify": "^17.0.0", | ||
| "jest": "^29.4.1", | ||
| "jest-it-up": "^2.1.0" | ||
| "jest-it-up": "^2.1.0", | ||
| "rimraf": "^5.0.0" | ||
| }, | ||
| "directories": { | ||
| "lib": "lib" | ||
|
|
@@ -72,5 +77,9 @@ | |
| "engines": { | ||
| "node": ">=18.0.0" | ||
| }, | ||
| "packageManager": "yarn@3.4.1" | ||
| "packageManager": "yarn@3.4.1", | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org/" | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow is a bit different, it seems, from how we've set up Pages deployment for other repos (e.g.
snap-account-abstraction-keyring). The way that these repos work is that when a new release is published, the site is deployed under both av${version}directory as well as alatestdirectory: https://github.com/MetaMask/snap-account-abstraction-keyring/blob/145dca2d936a7617332cccbbe28dfbaf52f341fd/.github/workflows/publish-release.yml#L104. Also, the site is deployed for release candidate PRs under anrc-${version}directory: https://github.com/MetaMask/snap-account-abstraction-keyring/blob/145dca2d936a7617332cccbbe28dfbaf52f341fd/.github/workflows/publish-rc-dapp.yml.Effectively, the site is versioned just like the package. Do we want to do that for this repo as well?