Skip to content

Commit

Permalink
Merge pull request #355 from SarjuHansaliya/implement_release_sourcemap
Browse files Browse the repository at this point in the history
create release & upload sourcemap to sentry
  • Loading branch information
HariSeldon23 authored Feb 21, 2022
2 parents 8bbae0e + 6664f74 commit c3e55b8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 43 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,65 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- uses: actions/[email protected]
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Configure Git
run: |
git config --global user.name 'Pangolin'
git config --global user.email '[email protected]'
- uses: actions/[email protected]
with:
node-version: ${{ env.node_version }}
- run: yarn --frozen-lockfile
env:
CI: true
- run: yarn build
- name: Prod - Increment version & create build # incrementing version automatically creates build internally with new version
run: npm run patch
if: ${{ github.ref == 'refs/heads/master' }}
env:
CI: false
REACT_APP_WYRE_API_KEY: ${{ secrets.REACT_APP_WYRE_API_KEY }}
REACT_APP_WYRE_ID: ${{ secrets.REACT_APP_WYRE_ID }}
REACT_APP_WYRE_SECRET_KEY: ${{ secrets.REACT_APP_WYRE_SECRET_KEY }}
REACT_APP_MOONPAY_PK: ${{ secrets.REACT_APP_MOONPAY_PK }}
- name: Dev - Increment version & create build # incrementing version automatically creates build internally with new version
run: npm version prerelease --preid=dev
if: ${{ github.ref == 'refs/heads/dev' }}
env:
CI: false
REACT_APP_WYRE_API_KEY: ${{ secrets.REACT_APP_WYRE_API_KEY }}
REACT_APP_WYRE_ID: ${{ secrets.REACT_APP_WYRE_ID }}
REACT_APP_WYRE_SECRET_KEY: ${{ secrets.REACT_APP_WYRE_SECRET_KEY }}
REACT_APP_MOONPAY_PK: ${{ secrets.REACT_APP_MOONPAY_PK }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
tags: true
- name: set versions to env
run: |
echo "TAG_VERSION=v$(npm run get:version --silent)" >> $GITHUB_ENV
echo "SENTRY_VERSION=pangolin-interface@$(npm run get:version --silent)" >> $GITHUB_ENV
- run: echo ${{ env.TAG_VERSION }}
- name: install sentry-cli
run: npm install -g @sentry/cli
- name: upload sourcemaps to sentry
run: |
sentry-cli --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} releases --org pangolin-tq --project pangolin-tq new ${{env.SENTRY_VERSION}} --finalize
sentry-cli --auth-token ${{ secrets.SENTRY_AUTH_TOKEN }} releases --org pangolin-tq --project pangolin-tq files "${{env.SENTRY_VERSION}}" upload-sourcemaps ./build/static/js
- name: Zip Assets
run: zip -r build.zip build
- name: Release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.ref == 'refs/heads/dev' }}
tag_name: ${{ env.TAG_VERSION }}
files: build.zip
- run: npx [email protected] ./build -p infura -p pinata -d cloudflare -O -C
env:
IPFS_DEPLOY_PINATA__API_KEY: ${{ secrets.PINATA_KEY }}
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"serve": "serve build -l 3000",
"version": "npm run build",
"get:version": "node -pe \"require('./package.json').version\"",
"integration-test": "start-server-and-test 'serve build -l 3000' http://localhost:3000 'cypress run'"
},
"eslintConfig": {
Expand Down

0 comments on commit c3e55b8

Please sign in to comment.