-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4341 from leather-wallet/release/tuesday
Release/tuesday
- Loading branch information
Showing
74 changed files
with
1,059 additions
and
226 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
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 |
---|---|---|
@@ -1,94 +1,71 @@ | ||
name: PR Extensions builds | ||
on: [pull_request, workflow_dispatch] | ||
|
||
env: | ||
COINBASE_APP_ID: ${{ secrets.COINBASE_APP_ID }} | ||
MOONPAY_API_KEY: ${{ secrets.MOONPAY_API_KEY }} | ||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | ||
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY_STAGING }} | ||
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }} | ||
WALLET_ENVIRONMENT: feature | ||
|
||
jobs: | ||
pre-run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/cancel-workflow-action@ad6cb1b847ffb509a69b745b6ee2f1d14dfe14b8 | ||
uses: styfle/cancel-workflow-action@main | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
update-pull-request-body: | ||
name: Add links to built extensions | ||
set-in-progress-message: | ||
if: github.repository == 'leather-wallet/extension' && github.actor != 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre-run | ||
steps: | ||
- uses: kyranjamie/[email protected] | ||
with: | ||
header: '> Try out this version of Leather — [download extension builds](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).' | ||
header: '> _Building Leather…_' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build_chrome_extension: | ||
name: Build debug Chrome extension | ||
build: | ||
name: build-${{ matrix.target }}-extension | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre-run | ||
strategy: | ||
matrix: | ||
target: [chromium, firefox] | ||
env: | ||
WALLET_ENVIRONMENT: feature | ||
TARGET_BROWSER: ${{ matrix.target }} | ||
COINBASE_APP_ID: ${{ secrets.COINBASE_APP_ID }} | ||
MOONPAY_API_KEY: ${{ secrets.MOONPAY_API_KEY }} | ||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | ||
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY_STAGING }} | ||
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }} | ||
PR_NUMBER: ${{ github.event.number }} | ||
COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }} | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- uses: ./.github/actions/provision | ||
|
||
- name: Add SHORT_SHA env property with commit short sha | ||
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | ||
|
||
- name: Build project | ||
run: yarn build | ||
|
||
- name: Build extension | ||
run: sh build-ext.sh | ||
|
||
- uses: actions/upload-artifact@v3 | ||
name: Upload Chrome Extension Zip | ||
name: Upload ${{ matrix.target }} Extension Zip | ||
with: | ||
name: stacks-wallet-chromium | ||
path: leather-chromium.zip | ||
name: leather-${{ matrix.target }}-${{ env.SHORT_SHA }} | ||
path: dist | ||
|
||
build_firefox: | ||
name: Build debug Firefox extension | ||
set-download-link: | ||
if: github.repository == 'leather-wallet/extension' && github.actor != 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre-run | ||
env: | ||
TARGET_BROWSER: firefox | ||
- build | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- uses: actions/cache@v3 | ||
id: cache-node-modules | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }} | ||
|
||
- uses: ./.github/actions/provision | ||
|
||
- name: Build project | ||
run: yarn build | ||
|
||
- name: Build extension | ||
run: sh build-ext.sh | ||
|
||
- name: Rename file | ||
run: mv leather-chromium.zip leather-firefox.zip | ||
|
||
- uses: actions/upload-artifact@v3 | ||
- uses: kyranjamie/[email protected] | ||
with: | ||
name: stacks-wallet-firefox | ||
path: leather-firefox.zip | ||
header: '> Try out this version of Leather — [download extension builds](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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
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,63 @@ | ||
import { useMemo } from 'react'; | ||
import { forwardRef } from 'react'; | ||
|
||
import { HTMLStyledProps, styled } from 'leather-styles/jsx'; | ||
|
||
import { BRANCH_NAME, COMMIT_SHA } from '@shared/environment'; | ||
|
||
import { openInNewTab } from '@app/common/utils/open-in-new-tab'; | ||
import { useIsLatestPullRequestBuild } from '@app/query/common/outdated-pr/outdated-pr.query'; | ||
|
||
import { Tooltip } from './tooltip'; | ||
|
||
interface AppVersionLabelProps extends HTMLStyledProps<'span'> { | ||
isLatestVersion: boolean; | ||
} | ||
const AppVersionLabel = forwardRef<HTMLSpanElement, AppVersionLabelProps>( | ||
({ children, isLatestVersion, ...props }: AppVersionLabelProps, ref) => ( | ||
<styled.span | ||
ref={ref} | ||
textStyle="mono" | ||
fontSize="10px" | ||
marginRight="10px" | ||
mb="-4px" | ||
ml="tight" | ||
opacity={0.5} | ||
textDecoration={isLatestVersion ? 'none' : 'line-through'} | ||
{...props} | ||
> | ||
{children} | ||
</styled.span> | ||
) | ||
); | ||
|
||
export function AppVersion() { | ||
const { pullRequestLink, isLatestBuild } = useIsLatestPullRequestBuild(); | ||
|
||
const version = useMemo(() => { | ||
switch (process.env.WALLET_ENVIRONMENT) { | ||
case 'development': | ||
return `dev@${BRANCH_NAME}`; | ||
case 'feature': | ||
return `${BRANCH_NAME}#${COMMIT_SHA?.slice(0, 8)}`; | ||
default: | ||
return `v${VERSION}`; | ||
} | ||
}, []); | ||
|
||
if (!isLatestBuild && process.env.WALLET_ENVIRONMENT === 'feature') { | ||
return ( | ||
<Tooltip label="Outdated PR build, download the latest version"> | ||
<AppVersionLabel | ||
isLatestVersion={false} | ||
cursor="pointer" | ||
onClick={() => openInNewTab(pullRequestLink ?? '')} | ||
> | ||
{version} | ||
</AppVersionLabel> | ||
</Tooltip> | ||
); | ||
} | ||
|
||
return <AppVersionLabel isLatestVersion>{version}</AppVersionLabel>; | ||
} |
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
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
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
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
Oops, something went wrong.