chore: turn on eslint rule and fix up some core internal imports #1148
Workflow file for this run
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
name: Build | |
on: | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
always-auth: true | |
node-version: '16.x' | |
registry-url: https://npm.pkg.github.com | |
scope: '@secretkeylabs' | |
- name: Install dependencies | |
run: npm ci --legacy-peer-deps | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGE_REGISTRY_TOKEN }} | |
- name: Test | |
run: npx eslint . | |
# run: npx tsc --noEmit | |
# run: npm test --passWithNoTests | |
- 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 }}\"}" |