Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: skip upload ci when changing non-kcl code #241

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions .github/workflows/update_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,39 @@ jobs:

- name: Publish to docker.io
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
./scripts/push_pkg_from.sh $file
done
if echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -q 'kcl.mod'; then
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
./scripts/push_pkg_from.sh $file
done
fi

- name: Publish to ghcr.io
run: |
kcl registry login -u ${{ secrets.DEPLOY_ACCESS_NAME }} -p ${{ secrets.DEPLOY_ACCESS_TOKEN }} ghcr.io
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
./scripts/push_pkg_from.sh $file
done
if echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -q 'kcl.mod'; then
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
./scripts/push_pkg_from.sh $file
done
fi
env:
KPM_REG: "ghcr.io"
KPM_REPO: "kcl-lang"

- name: Update artifacthub-pkg.yaml
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
go run main.go $file
done
if echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -q 'kcl.mod'; then
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
go run main.go $file
done
fi

- name: Commit and push changes
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
if echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -q 'kcl.mod'; then
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'

git add .
git commit -m "chore: update artifacthub-pkg.yaml"
git push
git add .
git commit -m "chore: update artifacthub-pkg.yaml"
git push
fi
Loading