Skip to content

Commit 6b4fe47

Browse files
committed
ci: add pii-model release workflow, guard npm-publish
New workflow builds and releases PII model bundles on pii-model-v* tags. npm-publish now skipped for non-v* releases.
1 parent 795994e commit 6b4fe47

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010

1111
jobs:
1212
npm:
13+
if: startsWith(github.event.release.tag_name, 'v')
1314
runs-on: ubuntu-latest
1415
steps:
1516
- uses: actions/checkout@v4

.github/workflows/pii-model.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: PII Model Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "pii-model-v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Extract version from tag
18+
id: version
19+
run: |
20+
TAG="${GITHUB_REF#refs/tags/pii-model-v}"
21+
echo "version=$TAG" >> "$GITHUB_OUTPUT"
22+
23+
- name: Build platform bundles
24+
run: ./scripts/prepare-pii-model.sh dist/pii-model
25+
env:
26+
PII_MODEL_VERSION: ${{ steps.version.outputs.version }}
27+
28+
- name: Create release and upload assets
29+
run: |
30+
gh release create "pii-model-v${{ steps.version.outputs.version }}" \
31+
--title "PII Model v${{ steps.version.outputs.version }}" \
32+
--notes "PII redaction model bundle (distilbert-base-multilingual-cased-ner-hrl, INT8 quantized) + ONNX Runtime." \
33+
dist/pii-model/pii-model-*.tar.gz
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/prepare-pii-model.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Output: per-platform tarballs + SHA-256 hashes ready for GitHub Release upload.
77
set -euo pipefail
88

9-
VERSION="1.0.0"
9+
VERSION="${PII_MODEL_VERSION:-1.0.0}"
1010
MODEL_REPO="Xenova/distilbert-base-multilingual-cased-ner-hrl"
1111
ORT_VERSION="1.23.0"
1212
OUTDIR="${1:-dist/pii-model}"

0 commit comments

Comments
 (0)