Skip to content

release: v0.26.2 to develop #1493

release: v0.26.2 to develop

release: v0.26.2 to develop #1493

Workflow file for this run

name: Build
on:
pull_request:
branches: [main, develop]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
always-auth: true
node-version: '18.x'
registry-url: https://npm.pkg.github.com
scope: '@secretkeylabs'
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGE_REGISTRY_TOKEN }}
run: npm ci
- name: Test
run: |
npx eslint .
npx tsc --noEmit
npm test
- name: Build
env:
TRANSAC_API_KEY: ${{ secrets.TRANSAC_API_KEY }}
MOON_PAY_API_KEY: ${{ secrets.MOON_PAY_API_KEY }}
MIX_PANEL_TOKEN: ${{ secrets.MIX_PANEL_TOKEN }}
run: npm run build --if-present
- name: Save Filename
run: |
BRANCH_NAME=$(echo ${{ github.head_ref }} | sed 's/\//-/g')
GIT_SHA_SHORT=$(git rev-parse --short ${{ github.sha }})
echo "FILENAME=xverse-extension.$BRANCH_NAME.$GIT_SHA_SHORT" >> $GITHUB_ENV
- name: Upload Archive
uses: actions/upload-artifact@v3
with:
name: ${{ env.FILENAME }}
path: ./build
retention-days: 30
if-no-files-found: error
comment-on-pr:
needs: build
runs-on: ubuntu-latest
steps:
- name: Get Artifact URL
env:
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
WORKFLOW_ID: ${{ github.run_id }}
run: |
ARTIFACT_URL="https://github.com/$OWNER/$REPO/actions/runs/$WORKFLOW_ID"
echo "ARTIFACT_URL=$ARTIFACT_URL" >> $GITHUB_ENV
- name: Delete old bot comments
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_ID: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
curl \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
https://api.github.com/repos/$REPO/issues/$PR_ID/comments \
| jq ".[] | select(.user.login==\"github-actions[bot]\") | .id" \
| xargs -I %q curl \
-L \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN"\
https://api.github.com/repos/$REPO/issues/comments/%q
- name: Post test package PR comment
if: ${{ github.event_name == 'pull_request' }}
env:
VERSION: ${{ steps.published-version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_URL: ${{ github.event.pull_request.comments_url }}
run: |
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
$GITHUB_URL \
-d "{\"body\":\"> Test with build here: ${{ env.ARTIFACT_URL }}\"}"