Skip to content

chore(main): Release transformation-azure-compliance-free v1.2.1 (#259) #9

chore(main): Release transformation-azure-compliance-free v1.2.1 (#259)

chore(main): Release transformation-azure-compliance-free v1.2.1 (#259) #9

name: Publish transformation free
on:
push:
tags:
- "transformation-*-free-v*.*.*"
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
transformation_dir: ${{ steps.split.outputs.transformation_dir }}
transformation_tier: ${{ steps.split.outputs.transformation_tier }}
transformation_version: ${{ steps.split.outputs.transformation_version }}
steps:
- name: Split tag
id: split
run: |
tag=${{ github.ref_name }}
# Trim transformation- prefix
transformation_dir=${tag#"transformation-"}
# Trim -free-v*.*.* suffix
transformation_dir=${transformation_dir%"-free"*}
# Replace - with _
transformation_dir=${transformation_dir//-/_}
transformation_tier=$(echo $tag | cut -d- -f4)
transformation_version=$(echo $tag | cut -d- -f5)
echo "transformation_dir=${transformation_dir}" >> $GITHUB_OUTPUT
echo "transformation_tier=${transformation_tier}" >> $GITHUB_OUTPUT
echo "transformation_version=${transformation_version}" >> $GITHUB_OUTPUT
publish-transformation-free:
needs: prepare
runs-on: ubuntu-latest
defaults:
run:
working-directory: transformations/${{ needs.prepare.outputs.transformation_dir }}
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: context.ref.replace('refs/tags/', ''),
});
const releaseNotes = data.body;
const linksRemoved = releaseNotes.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1');
const changelogPath = `transformations/${TRANSFORMATION_DIR}/changelog.md`;
await fs.writeFile(changelogPath, linksRemoved);
- name: Run build
run: |
make build-free
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@v3
with:
version: v3.29.1
- name: Publish tranformation
env:
CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}
run: |
cloudquery addon publish manifest-free.json ${{ needs.prepare.outputs.transformation_version }} -f