fix: SLS support #105
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: Deploy to npm | |
on: | |
workflow_dispatch: | |
branches: [main] | |
push: | |
branches: [main] | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: lldebugger | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: npm ci | |
- name: Typecheck | |
run: npm run typecheck | |
- name: Compile TypeScript | |
run: npm run build | |
- name: Build and package extension | |
working-directory: ./src/extension | |
run: npm run build | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-west-1 | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
role-session-name: GitHubActions | |
- name: Bootstrap CDK | |
# so I do not have to do it manually when CDK is updated | |
run: npx cdk bootstrap aws://${{secrets.AWS_ACCOUNT_ID}}/eu-west-1 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
test-cdk-simple: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
concurrency: | |
group: lldebugger | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: npm ci | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-west-1 | |
role-to-assume: ${{ secrets.AWS_ROLE }} | |
role-session-name: GitHubActions | |
- name: Test | |
run: npx vitest test/cdk-simple.test.ts | |
publish: | |
needs: | |
- test-cdk-simple | |
runs-on: ubuntu-latest | |
concurrency: | |
group: lldebugger | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: npm ci | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Semantic Release | |
run: | | |
npm whoami | |
npx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.PRIVATE_GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |