chore: update to latest npm version to esnure we have one compatible with trusted publishing for publib from jsii #155
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: build | |
| on: | |
| pull_request: {} | |
| workflow_dispatch: {} | |
| env: | |
| node_version: 22 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| self_mutation_happened: ${{ steps.self_mutation.outputs.self_mutation_happened }} | |
| env: | |
| CI: 'true' | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| - name: Configure AWS credentials from Test account | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ${{ secrets.AWS_REGION }} | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.node_version }} | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: sudo docker | |
| run: sudo chmod 777 /var/run/docker.sock | |
| - name: Install dependencies | |
| run: npm install | |
| - name: build | |
| run: scripts/run-task build | |
| - name: Upload artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: build-artifact | |
| path: dist | |
| container: | |
| image: jsii/superchain:1-buster-slim-node14 | |
| package-js: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| if: '! needs.build.outputs.self_mutation_happened' | |
| steps: | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.node_version }} | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: build-artifact | |
| path: dist | |
| - name: Prepare Repository | |
| run: mv dist .repo | |
| - name: Install Dependencies | |
| run: cd .repo && npm ci | |
| - name: Create js artifact | |
| run: cd .repo && npx projen package:js | |
| - name: Collect js Artifact | |
| run: mv .repo/dist dist |