Skip to content

chore: release v0.0.18 #47

chore: release v0.0.18

chore: release v0.0.18 #47

Workflow file for this run

---
name: Release
concurrency: release
on:
push:
branches:
- main
permissions:
contents: write
id-token: write
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout the code
- name: Install and build
uses: ./.github/actions/install-and-build
- name: Run Tests
run: pnpm test
e2e-tests:
name: End-to-end tests
needs: ["tests"]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
example: [api-lambda-auth]
steps:
- uses: actions/checkout@v3
name: Checkout the code
- name: Install and build
uses: ./.github/actions/install-and-build
with:
lint: false
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: eu-central-1
- uses: hashicorp/setup-terraform@v2
with:
terraform_wrapper: false
- name: Install example
env:
TF_STATE_BUCKET: ${{ secrets.TF_STATE_BUCKET }}
TF_STATE_LOCK_TABLE: ${{ secrets.TF_STATE_LOCK_TABLE }}
working-directory: examples/${{ matrix.example }}
run: |
pnpm install
pnpm synth -n ci-${{ matrix.example }}
pnpm build
- name: Deploy the example
working-directory: examples/${{ matrix.example }}/cdktf.out/stacks/deployment
id: deploy
run: |
terraform init
terraform apply -auto-approve
terraform output -json | jq '"SDF_TEST_API_URL=" + .api_url.value' -r >> $GITHUB_OUTPUT
- name: Run tests
working-directory: examples/${{ matrix.example }}
env:
SDF_TEST_API_URL: ${{ steps.deploy.outputs.SDF_TEST_API_URL }}
run: |
pnpm jest
- name: Cleanup
if: ${{ always() && steps.deploy.conclusion == 'success' }}
working-directory: examples/${{ matrix.example }}/cdktf.out/stacks/deployment
run: terraform apply -destroy -auto-approve
publish:
needs: [tests, e2e-tests]
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout the code
- name: Install and build
uses: ./.github/actions/install-and-build
- name: Publish
uses: JS-DevTools/npm-publish@v1
id: publish
with:
token: ${{ secrets.NPMJS_TOKEN }}
access: public
check-version: true
package: dist/package.json
- name: Tag
if: steps.publish.outputs.type != 'none'
run: |
git tag v${{ steps.publish.outputs.version }}
git push --tags