Skip to content

chore(main): Release transformation-azure-compliance-premium v0.1.2 (… #1

chore(main): Release transformation-azure-compliance-premium v0.1.2 (…

chore(main): Release transformation-azure-compliance-premium v0.1.2 (… #1

name: Publish transformation
on:
push:
tags:
- "transformation-*-v*.*.*"
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
transformation_dir: ${{ fromJson(steps.set-result.outputs.result).transformation_dir }}
transformation_version: ${{ fromJson(steps.set-result.outputs.result).transformation_version }}
steps:
- uses: actions/github-script@v7
id: set-result
env:
TRANSFORMATION_TAG: transformation-k8s-compliance-free-v1.2.0
with:
script: |
const { TRANSFORMATION_TAG } = process.env;
const [_, topLevelDir, ...rest] = TRANSFORMATION_TAG.split('-');
const version = rest.pop();
return {
transformation_dir: `${topLevelDir}/${rest.join('-')}`,
transformation_version: version,
};
publish-transformation:
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Release Notes
uses: actions/github-script@v7
env:
TRANSFORMATION_DIR: ${{ needs.prepare.outputs.transformation_dir }}
with:
script: |
const fs = require('fs/promises');
const { TRANSFORMATION_DIR } = process.env;
const { data } = await github.rest.repos.getReleaseByTag({
owner: "cloudquery",
repo: context.repo.repo,
tag: 'transformation-k8s-compliance-free-v1.2.0',
});
const releaseNotes = data.body;
const linksRemoved = releaseNotes.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1');
const changelogPath = `transformations/${TRANSFORMATION_DIR}/changelog.md`;
await fs.writeFile(changelogPath, linksRemoved);
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "./transformations/${{ needs.prepare.outputs.transformation_dir }}/requirements.txt"
- name: Install dependencies
working-directory: transformations/${{ needs.prepare.outputs.transformation_dir }}
run: pip install -r requirements.txt
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: scripts/dbt-pack/package-lock.json
- name: Install Dependencies
run: npm ci
working-directory: ./scripts/dbt-pack
- name: Pack DBT
working-directory: ./scripts/dbt-pack
run: node index.js dbt-pack --project-dir=../../transformations/${{ needs.prepare.outputs.transformation_dir }}
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@v3
with:
version: v4.0.0
- name: Publish tranformation
working-directory: transformations/${{ needs.prepare.outputs.transformation_dir }}
env:
CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}
run: |
cloudquery addon publish manifest.json ${{ needs.prepare.outputs.transformation_version }} -f