Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into mahmoud/eng-3111-i…
Browse files Browse the repository at this point in the history
…ntegrate-with-stacks-raw-hex-signing-on-extension
  • Loading branch information
m-aboelenein committed Dec 18, 2023
2 parents fef354f + ec09afe commit 0d0a5c4
Show file tree
Hide file tree
Showing 68 changed files with 2,125 additions and 547 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Create release PR

on:
workflow_dispatch:
inputs:
bump:
description: 'Version bump level'
required: true
default: patch
type: choice
options:
- patch
- minor
- major

jobs:
create-release-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- id: run-create-release-pr-sh
env:
BUMP: ${{ inputs.bump }}
GH_TOKEN: ${{ github.token }}
run: |
# git config
git config user.name "GitHub Actions Bot"
git config user.email "<>"
# run shell script
cd scripts
./create-release-pr.sh
57 changes: 22 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "xverse-web-extension",
"description": "A Bitcoin wallet for Web3",
"version": "0.24.0",
"version": "0.26.0",
"private": true,
"engines": {
"node": "^18.18.2"
Expand All @@ -10,7 +10,7 @@
"@ledgerhq/hw-transport-webusb": "^6.27.13",
"@phosphor-icons/react": "^2.0.10",
"@react-spring/web": "^9.6.1",
"@secretkeylabs/xverse-core": "5.0.0-fc584e8",
"@secretkeylabs/xverse-core": "5.3.0-f0200da",
"@stacks/connect": "7.4.1",
"@stacks/stacks-blockchain-api-types": "6.1.1",
"@stacks/transactions": "6.9.0",
Expand Down
3 changes: 3 additions & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
release.json
pr-*.json
body.md
74 changes: 74 additions & 0 deletions scripts/create-release-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#! /bin/bash

if [[ -z "$BUMP" ]]; then
echo "BUMP is required. major|minor|patch"
exit 1
fi

echo -e "\n--- Prepare for $BUMP release branch ---"

git fetch --all
git checkout develop
git pull

npm version $BUMP --git-tag-version=false
VERSION=$(npm pkg get version | sed 's/"//g')
TAG="v$VERSION"
BRANCH="release/$TAG"
TITLE="release: $TAG"

git checkout -B $BRANCH
git commit -am "$TITLE"
git merge origin/main -s ours

git push --set-upstream origin $BRANCH

echo -e "\n--- Create draft release for $TAG ---"

gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/{owner}/{repo}/releases \
-f tag_name=$TAG \
-f target_commitish="$BRANCH" \
-f name=$TAG \
-F draft=true \
-F prerelease=true \
-F generate_release_notes=true > release.json

cat release.json | jq -r .body > body.md
echo -e "\n\nDraft release: $(cat release.json | jq -r .html_url)" >> body.md

for b in main develop; do
echo -e "\n--- Create PR to $b ---"

gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/{owner}/{repo}/pulls \
-f title="$TITLE to $b" \
-f body="Created by GitHub Actions Bot" \
-f head="$BRANCH" \
-f base="$b" > pr-$b.json

echo -e "\n--- Update PR to $b with description ---"

PR_ID=$(cat pr-$b.json | jq -r .number)

gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/{owner}/{repo}/pulls/$PR_ID \
-F 'body=@body.md'

# clean up temp files
# rm pr-$b.json
done

echo -e "\n--- Done ---"
# clean up temp files
# rm release.json
# rm body.md
19 changes: 18 additions & 1 deletion src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import LoadingScreen from '@components/loadingScreen';
import { CheckCircle } from '@phosphor-icons/react';
import rootStore from '@stores/index';
import { QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
Expand Down Expand Up @@ -40,7 +41,23 @@ function App(): JSX.Element {
<SessionGuard>
<ThemeProvider theme={Theme}>
<RouterProvider router={router} />
<Toaster position="bottom-center" />
<Toaster
position="bottom-center"
containerStyle={{ bottom: 80 }}
toastOptions={{
success: {
icon: <CheckCircle size={20} weight="bold" />,
style: {
...Theme.typography.body_medium_m,
backgroundColor: Theme.colors.success_medium,
borderRadius: Theme.radius(2),
padding: Theme.spacing(4),
paddingLeft: Theme.spacing(6),
color: Theme.colors.elevation0,
},
},
}}
/>
</ThemeProvider>
</SessionGuard>
</PersistGate>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/bottomModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Modal from 'react-modal';
import styled, { useTheme } from 'styled-components';

const BottomModalHeaderText = styled.h1((props) => ({
...props.theme.body_bold_m,
...props.theme.typography.body_bold_l,
flex: 1,
}));

Expand Down
6 changes: 3 additions & 3 deletions src/app/components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interface Props {
icon?: JSX.Element;
iconPosition?: 'left' | 'right';
text: string;
onPress: () => void;
onPress: (e: React.MouseEvent<HTMLButtonElement>) => void;
processing?: boolean;
disabled?: boolean;
transparent?: boolean;
Expand All @@ -102,9 +102,9 @@ function ActionButton({
warning,
hoverDialogId,
}: Props) {
const handleOnPress = () => {
const handleOnPress = (e: React.MouseEvent<HTMLButtonElement>) => {
if (!disabled) {
onPress();
onPress(e);
}
};

Expand Down
Loading

0 comments on commit 0d0a5c4

Please sign in to comment.