Skip to content

Commit de3cb46

Browse files
committed
chore(ci): add artifact security scanning to release pipelines
- Add gh-action-scan before git push in both release workflows, so compromised artifacts block the release before any tag is published - Decouple npm publish from release-it's after:release hook into explicit workflow steps for better control flow - Uncomment push-to-main triggers for both release workflows - Use databricks/gh-action-scan composite action (SHA-pinned) Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
1 parent 72b6289 commit de3cb46

File tree

4 files changed

+75
-18
lines changed

4 files changed

+75
-18
lines changed

.github/workflows/release-lakebase.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Release @databricks/lakebase
22

33
on:
4-
# push:
5-
# branches:
6-
# - main
7-
# paths:
8-
# - 'packages/lakebase/**'
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'packages/lakebase/**'
99
workflow_dispatch:
1010
inputs:
1111
dry-run:
@@ -61,13 +61,38 @@ jobs:
6161
- name: Install dependencies
6262
run: pnpm install --frozen-lockfile
6363

64-
- name: Release
64+
- name: Release (build + tag locally)
6565
working-directory: packages/lakebase
6666
run: |
6767
if [ "$DRY_RUN" == "true" ]; then
6868
pnpm release:dry
6969
else
70-
pnpm release:ci
70+
pnpm exec release-it --ci --no-git.push --no-github.release
7171
fi
7272
env:
7373
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
75+
- name: Security scan
76+
if: env.DRY_RUN != 'true'
77+
uses: databricks-eng/gh-action-scan@1c260de6986f77d8c505975ce434830a7afdb95f
78+
with:
79+
artifact-path: packages/lakebase/tmp
80+
artifact-name: lakebase
81+
82+
- name: Push tag and create GitHub release
83+
if: env.DRY_RUN != 'true'
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
run: |
87+
VERSION=$(node -p "require('./packages/lakebase/package.json').version")
88+
git push --follow-tags
89+
NOTES=$(awk '/^## \[/{if(p) exit; p=1} p' packages/lakebase/CHANGELOG.md)
90+
gh release create "lakebase-v${VERSION}" \
91+
--title "@databricks/lakebase v${VERSION}" \
92+
--notes "$NOTES"
93+
94+
- name: Publish to npm
95+
if: env.DRY_RUN != 'true'
96+
run: npm publish packages/lakebase/tmp --access public --provenance
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Release
22

33
on:
4-
# push:
5-
# branches:
6-
# - main
7-
# paths-ignore:
8-
# - 'packages/lakebase/**'
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'packages/lakebase/**'
99
workflow_dispatch:
1010
inputs:
1111
dry-run:
@@ -82,16 +82,50 @@ jobs:
8282
echo "No releasable version detected"
8383
fi
8484
85-
- name: Release
85+
- name: Release (build + tag locally, no push)
8686
run: |
8787
if [ "${{ steps.mode.outputs.dry_run }}" == "true" ]; then
8888
pnpm release:dry
8989
else
90-
pnpm release:ci
90+
pnpm exec release-it --ci --no-git.push --no-github.release
9191
fi
9292
env:
9393
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9494

95+
- name: Security scan (appkit)
96+
if: steps.mode.outputs.dry_run != 'true' && steps.version.outputs.version != ''
97+
uses: databricks-eng/gh-action-scan@1c260de6986f77d8c505975ce434830a7afdb95f
98+
with:
99+
artifact-path: packages/appkit/tmp
100+
artifact-name: appkit-${{ steps.version.outputs.version }}
101+
102+
- name: Security scan (appkit-ui)
103+
if: steps.mode.outputs.dry_run != 'true' && steps.version.outputs.version != ''
104+
uses: databricks-eng/gh-action-scan@1c260de6986f77d8c505975ce434830a7afdb95f
105+
with:
106+
artifact-path: packages/appkit-ui/tmp
107+
artifact-name: appkit-ui-${{ steps.version.outputs.version }}
108+
109+
- name: Push tag and create GitHub release
110+
if: steps.mode.outputs.dry_run != 'true' && steps.version.outputs.version != ''
111+
env:
112+
VERSION: ${{ steps.version.outputs.version }}
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
run: |
115+
git push --follow-tags
116+
NOTES=$(awk '/^## \[/{if(p) exit; p=1} p' CHANGELOG.md)
117+
gh release create "v${VERSION}" \
118+
--title "AppKit v${VERSION}" \
119+
--notes "$NOTES"
120+
121+
- name: Publish to npm
122+
if: steps.mode.outputs.dry_run != 'true' && steps.version.outputs.version != ''
123+
run: |
124+
npm publish packages/appkit/tmp --access public --provenance
125+
npm publish packages/appkit-ui/tmp --access public --provenance
126+
env:
127+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128+
95129
sync-template:
96130
runs-on:
97131
group: databricks-protected-runner-group

.release-it.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"hooks": {
2626
"before:init": "pnpm audit --audit-level=high --prod",
2727
"after:bump": "tsx tools/sync-versions.ts ${version} && pnpm build:notice && git add NOTICE.md",
28-
"before:release": "pnpm build && pnpm --filter=docs build && pnpm --filter=@databricks/appkit dist && pnpm --filter=@databricks/appkit-ui dist && pnpm release:sbom",
29-
"after:release": "npm publish packages/appkit/tmp --access public --provenance && npm publish packages/appkit-ui/tmp --access public --provenance"
28+
"before:release": "pnpm build && pnpm --filter=docs build && pnpm --filter=@databricks/appkit dist && pnpm --filter=@databricks/appkit-ui dist && pnpm release:sbom"
3029
},
3130
"plugins": {
3231
"@release-it/conventional-changelog": {

packages/lakebase/.release-it.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"hooks": {
2424
"before:init": "pnpm audit --audit-level=high --prod",
2525
"after:bump": "npm version ${version} --no-git-tag-version --allow-same-version",
26-
"before:release": "pnpm build:package && pnpm dist && pnpm release:sbom",
27-
"after:release": "npm publish ./tmp --access public --provenance"
26+
"before:release": "pnpm build:package && pnpm dist && pnpm release:sbom"
2827
},
2928
"plugins": {
3029
"@release-it/conventional-changelog": {

0 commit comments

Comments
 (0)