-
Notifications
You must be signed in to change notification settings - Fork 23
70 lines (57 loc) · 1.92 KB
/
update_metadata.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Publish Package
on:
push:
branches:
- main
env:
KPM_REG: "docker.io"
KPM_REPO: "kcllang"
jobs:
publish_pkg:
# NOTE:
# - This is limited to pull_request* events and would raise an error for other events.
# - A maximum of 3000 files can be returned.
# - For more flexibility and no limitations see "Using local .git history" above.
runs-on: ubuntu-latest
name: Update Package Info on AH
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Install kpm
run: go install kcl-lang.io/kpm@latest
- name: login
run: kpm login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} docker.io
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
- name: publish to docker.io
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
./scripts/push_pkg_from.sh $file
done
- name: publish to ghcr.io
run: |
kpm 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
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
- name: Commit and push changes
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add .
git commit -m "Updata artifacthub-pkg.yaml for ${{ github.event.registry_package.name }}"
git push