fix: resolve npm audit vulnerabilities in production dependencies (#1… #226
This file contains hidden or 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: Prerelease Tarball | |
| on: | |
| push: | |
| branches: [main] | |
| # Manually trigger to pull in the latest CDK constructs changes | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: prerelease-tarball | |
| cancel-in-progress: true | |
| jobs: | |
| prerelease-tarball: | |
| runs-on: codebuild-agentcore-e2e-${{ github.run_id }}-${{ github.run_attempt }} | |
| timeout-minutes: 15 | |
| env: | |
| TARBALL_BASE: agentcore-cli-prerelease | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Generate GitHub App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| app-id: ${{ vars.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| owner: aws | |
| - name: Clone CDK repo | |
| run: | | |
| git clone --depth 1 "https://x-access-token:${CDK_REPO_TOKEN}@github.com/${CDK_REPO}.git" /tmp/cdk-repo | |
| env: | |
| CDK_REPO_TOKEN: ${{ steps.app-token.outputs.token }} | |
| CDK_REPO: ${{ secrets.CDK_REPO_NAME }} | |
| - name: Compute version suffix | |
| id: version | |
| run: | | |
| CLI_SHA=$(git rev-parse --short=5 HEAD) | |
| CDK_SHA=$(git -C /tmp/cdk-repo rev-parse --short=5 HEAD) | |
| SUFFIX="${CLI_SHA}-${CDK_SHA}" | |
| echo "suffix=$SUFFIX" >> $GITHUB_OUTPUT | |
| echo "Version suffix: $SUFFIX" | |
| - run: npm run bundle | |
| env: | |
| AGENTCORE_CDK_PATH: /tmp/cdk-repo | |
| AGENTCORE_TARBALL_OUTPUT: ${{ env.TARBALL_BASE }} | |
| AGENTCORE_TARBALL_VERSION_SUFFIX: ${{ steps.version.outputs.suffix }} | |
| - name: Create or update prerelease | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| VERSION_SUFFIX: ${{ steps.version.outputs.suffix }} | |
| run: | | |
| TAG="prerelease" | |
| # Delete existing release if it exists (to update the tarballs) | |
| gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true | |
| # Create a new pre-release with the tarball | |
| gh release create "$TAG" \ | |
| "${TARBALL_BASE}.tgz" \ | |
| --title "Prerelease" \ | |
| --notes "Auto-generated tarball from the latest commit on main. | |
| Version: \`${VERSION_SUFFIX}\` (cli-cdk) | |
| \`\`\` | |
| npm install -g https://github.com/aws/agentcore-cli/releases/download/prerelease/${TARBALL_BASE}.tgz | |
| \`\`\`" \ | |
| --prerelease \ | |
| --target "${{ github.sha }}" |