|
| 1 | +name: Bump @bitgo-beta SDK Dependencies |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: write |
| 8 | + pull-requests: write |
| 9 | + |
| 10 | +jobs: |
| 11 | + bump-sdk: |
| 12 | + name: Bump SDK deps and open PR |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + ref: master |
| 19 | + |
| 20 | + - name: Setup Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: '22.1.0' |
| 24 | + cache: 'npm' |
| 25 | + |
| 26 | + - name: Install current dependencies |
| 27 | + run: npm ci |
| 28 | + |
| 29 | + - name: Bump @bitgo-beta versions |
| 30 | + run: npm run bump-versions |
| 31 | + |
| 32 | + - name: Regenerate lockfile |
| 33 | + run: npm install --package-lock-only |
| 34 | + |
| 35 | + - name: Install updated dependencies |
| 36 | + run: npm ci |
| 37 | + |
| 38 | + - name: Lint |
| 39 | + run: npm run lint |
| 40 | + |
| 41 | + - name: Build |
| 42 | + run: npm run build |
| 43 | + |
| 44 | + - name: Generate test SSL certificates |
| 45 | + run: npm run generate-test-ssl |
| 46 | + |
| 47 | + - name: Test |
| 48 | + run: npm test |
| 49 | + env: |
| 50 | + NODE_OPTIONS: '--max-old-space-size=4096' |
| 51 | + MASTER_BITGO_EXPRESS_KEYPATH: ./demo.key |
| 52 | + MASTER_BITGO_EXPRESS_CRTPATH: ./demo.crt |
| 53 | + MTLS_ENABLED: true |
| 54 | + MTLS_REQUEST_CERT: true |
| 55 | + MTLS_REJECT_UNAUTHORIZED: false |
| 56 | + KEY_PROVIDER_URL: 'https://localhost:3000/' |
| 57 | + |
| 58 | + - name: Check for changes |
| 59 | + id: changes |
| 60 | + run: | |
| 61 | + if git diff --quiet HEAD -- package.json package-lock.json; then |
| 62 | + echo "changed=false" >> $GITHUB_OUTPUT |
| 63 | + else |
| 64 | + echo "changed=true" >> $GITHUB_OUTPUT |
| 65 | + fi |
| 66 | +
|
| 67 | + - name: Commit and push branch |
| 68 | + id: push-branch |
| 69 | + if: steps.changes.outputs.changed == 'true' |
| 70 | + run: | |
| 71 | + DATE=$(date +'%Y-%m-%d') |
| 72 | + BRANCH="chore/bump-bitgo-beta-$(date +'%Y%m%d-%H%M')" |
| 73 | + git config user.name "github-actions[bot]" |
| 74 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 75 | + git checkout -b "$BRANCH" |
| 76 | + git add package.json package-lock.json |
| 77 | + git commit -m "chore: bump @bitgo-beta dependencies ${DATE}" |
| 78 | + git push origin "$BRANCH" |
| 79 | + echo "branch=$BRANCH" >> $GITHUB_OUTPUT |
| 80 | + echo "date=$DATE" >> $GITHUB_OUTPUT |
| 81 | +
|
| 82 | + - name: Open draft PR |
| 83 | + if: steps.changes.outputs.changed == 'true' |
| 84 | + run: | |
| 85 | + gh pr create \ |
| 86 | + --title "chore: bump @bitgo-beta dependencies ${{ steps.push-branch.outputs.date }}" \ |
| 87 | + --body "Automated weekly bump of \`@bitgo-beta/*\` dependencies. |
| 88 | +
|
| 89 | + Build and tests passed on this branch before opening." \ |
| 90 | + --base master \ |
| 91 | + --head "${{ steps.push-branch.outputs.branch }}" \ |
| 92 | + --draft |
| 93 | + env: |
| 94 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments