forked from MetaMask/metamask-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: drptbl <[email protected]>
- Loading branch information
Showing
2 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Monitor Upstream Releases | ||
|
||
on: | ||
schedule: | ||
- cron: '*/30 * * * *' # Check every 30 minutes | ||
|
||
jobs: | ||
check-releases: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for new releases | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
LATEST_RELEASE=$(curl -s "https://api.github.com/repos/MetaMask/metamask-extension/releases/latest" | jq -r .tag_name) | ||
echo "Latest upstream release: $LATEST_RELEASE" | ||
curl -X POST \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
-d "{\"event_type\": \"upstream-release\", \"client_payload\": {\"release\": \"$LATEST_RELEASE\"}}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/dispatches" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Sync Fork and Build Without LavaMoat | ||
|
||
on: | ||
# Trigger on new releases in the original repo | ||
repository_dispatch: | ||
types: [upstream-release] | ||
# Allow manual trigger | ||
workflow_dispatch: | ||
# Check for updates every day | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
sync-and-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
- name: Add upstream remote | ||
run: | | ||
git remote add upstream https://github.com/MetaMask/metamask-extension.git | ||
git fetch upstream | ||
- name: Sync with upstream | ||
run: | | ||
git checkout develop | ||
git merge upstream/develop | ||
git push origin develop | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Enable Corepack | ||
run: corepack enable | ||
|
||
- name: Setup environment | ||
env: | ||
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }} | ||
run: | | ||
# Copy the dist file | ||
cp .metamaskrc.dist .metamaskrc | ||
# Use different sed syntax for Linux | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
sed -i '' "s/INFURA_PROJECT_ID=.*/INFURA_PROJECT_ID=$INFURA_PROJECT_ID/g" .metamaskrc | ||
else | ||
sed -i "s/INFURA_PROJECT_ID=.*/INFURA_PROJECT_ID=$INFURA_PROJECT_ID/g" .metamaskrc | ||
fi | ||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build without LavaMoat | ||
run: yarn dist --apply-lavamoat=false | ||
|
||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
VERSION=$(node -p "require('./package.json').version") | ||
gh release create "v${VERSION}-no-lavamoat" \ | ||
--title "v${VERSION} (No LavaMoat)" \ | ||
--notes "MetaMask v${VERSION} built without LavaMoat" \ | ||
./builds/metamask-chrome-*.zip \ | ||
./builds/metamask-firefox-*.zip |