Skip to content

Fix CICD

Fix CICD #56

Workflow file for this run

name: Deploy to npm
on:
workflow_dispatch:
branches: [main]
push:
branches: [main]
release:
types: [created]
permissions:
id-token: write
contents: read
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: Semantic Release
# run: npx semantic-release
- 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/download-artifact@v4
# with:
# name: dist
# path: dist
# - uses: actions/checkout@v4
# - name: Use Node.js
# uses: actions/setup-node@v4
# with:
# node-version: "20"
# registry-url: "https://registry.npmjs.org"
# - name: Publish to npm
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}