File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed
Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+ - uses : cachix/install-nix-action@v27
15+ with :
16+ github_access_token : ${{ secrets.GITHUB_TOKEN }}
17+ - uses : nicknovitski/nix-develop@v1
18+ - run : kcl test ./...
Original file line number Diff line number Diff line change 1+ name : Publish to npm
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - " **.mod"
9+
10+ jobs :
11+ publish :
12+ runs-on : ubuntu-latest
13+ steps :
14+ - uses : actions/checkout@v4
15+ - uses : cachix/install-nix-action@v27
16+ with :
17+ github_access_token : ${{ secrets.GITHUB_TOKEN }}
18+ - uses : nicknovitski/nix-develop@v1
19+ - uses : tj-actions/changed-files@v41
20+ id : changed-files
21+ - run : kcl registry login -u ${{ github.actor }}} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
22+ - name : Publish to ghcr.io
23+ run : |
24+ if echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -q 'kcl.mod'; then
25+ for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
26+ if [[ "$file" != *"/kcl.mod" ]]; then
27+ continue
28+ fi
29+ PKG_PATH=$(dirname $file)
30+ PKG_NAME=$(basename $PKG_PATH)
31+ pushd $PKG_PATH
32+ kcl mod push oci://ghcr.io/$GITHUB_REPOSITORY_OWNER/kcl/$PKG_NAME
33+ popd
34+ done
35+ fi
You can’t perform that action at this time.
0 commit comments