|
5 | 5 | release:
|
6 | 6 | types: [released]
|
7 | 7 |
|
8 |
| -env: |
9 |
| - ACTIONS_RUNNER_DEBUG: false |
10 |
| - CI_COMMIT_MESSAGE: CI Build Artifacts |
11 |
| - TARGET_BRANCH: gh-pages |
12 |
| - |
13 | 8 | defaults:
|
14 | 9 | run:
|
15 | 10 | shell: bash
|
16 | 11 | working-directory: ./
|
17 | 12 |
|
18 | 13 | jobs:
|
19 |
| - build-extension-artifact: |
20 |
| - name: Build extension artifact |
21 |
| - runs-on: ubuntu-latest |
22 |
| - permissions: |
23 |
| - actions: write |
24 |
| - contents: read |
25 |
| - steps: |
26 |
| - - name: Checkout |
27 |
| - uses: actions/checkout@v3 |
28 |
| - with: |
29 |
| - fetch-depth: 0 |
30 |
| - |
31 |
| - - name: Configure Git |
32 |
| - run: | |
33 |
| - git config user.name 'github-actions[bot]' |
34 |
| - git config user.email 'github-actions[bot]@users.noreply.github.com' |
35 |
| -
|
36 |
| - - name: Setup Helm |
37 |
| - uses: azure/setup-helm@v3 |
38 |
| - with: |
39 |
| - version: v3.8.0 |
40 |
| - |
41 |
| - - name: Setup Nodejs and npm |
42 |
| - uses: actions/setup-node@v3 |
43 |
| - with: |
44 |
| - node-version: '16' |
45 |
| - |
46 |
| - - name: Setup yarn |
47 |
| - run: npm install -g yarn |
48 |
| - |
49 |
| - - name: Setup Nodejs with yarn caching |
50 |
| - uses: actions/setup-node@v3 |
51 |
| - with: |
52 |
| - node-version: '16' |
53 |
| - cache: yarn |
54 |
| - |
55 |
| - - name: Install dependencies |
56 |
| - run: yarn |
57 |
| - |
58 |
| - - name: Parse Extension Name |
59 |
| - if: github.ref_type == 'tag' |
60 |
| - id: parsed-name |
61 |
| - env: |
62 |
| - GH_TOKEN: ${{ github.token }} |
63 |
| - run: | |
64 |
| - chmod +x ./node_modules/@rancher/shell/scripts/extension/parse-tag-name |
65 |
| - yarn parse-tag-name ${{ github.ref_name }} ${{ github.run_id }} "charts" |
66 |
| -
|
67 |
| - - name: Run build script |
68 |
| - shell: bash |
69 |
| - id: build_script |
70 |
| - run: | |
71 |
| - publish="yarn publish-pkgs -s ${{ github.repository }} -b ${{ env.TARGET_BRANCH }}" |
72 |
| -
|
73 |
| - if [[ -n "${{ github.ref_name }}" ]]; then |
74 |
| - publish="$publish -t ${{ github.ref_name }}" |
75 |
| - fi |
76 |
| - |
77 |
| - $publish |
78 |
| -
|
79 |
| - - name: Upload charts artifact |
80 |
| - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') |
81 |
| - uses: actions/upload-artifact@v3 |
82 |
| - with: |
83 |
| - name: charts |
84 |
| - path: tmp |
85 |
| - |
86 |
| - release: |
87 |
| - name: Release Build |
88 |
| - if: github.ref_type == 'tag' || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request') |
89 |
| - needs: build-extension-artifact |
90 |
| - runs-on: ubuntu-latest |
| 14 | + build-extension-charts: |
| 15 | + uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@master |
91 | 16 | permissions:
|
92 | 17 | actions: write
|
93 | 18 | contents: write
|
94 | 19 | deployments: write
|
95 | 20 | pages: write
|
96 |
| - steps: |
97 |
| - - name: Checkout |
98 |
| - uses: actions/checkout@v3 |
99 |
| - with: |
100 |
| - ref: "${{ env.TARGET_BRANCH }}" |
101 |
| - |
102 |
| - - name: Configure Git |
103 |
| - run: | |
104 |
| - git config user.name 'github-actions[bot]' |
105 |
| - git config user.email 'github-actions[bot]@users.noreply.github.com' |
106 |
| -
|
107 |
| - - name: Download build artifact |
108 |
| - uses: actions/download-artifact@v3 |
109 |
| - with: |
110 |
| - name: charts |
111 |
| - |
112 |
| - - name: Commit build |
113 |
| - run: | |
114 |
| - git add ./{assets,charts,extensions,index.yaml} |
115 |
| - git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" |
116 |
| - git push |
| 21 | + with: |
| 22 | + target_branch: gh-pages |
| 23 | + tagged_release: ${{ github.ref_name }} |
117 | 24 |
|
118 |
| - - name: Run chart-releaser |
119 |
| - |
120 |
| - with: |
121 |
| - charts_dir: ./charts/* |
122 |
| - env: |
123 |
| - CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' |
124 |
| - CR_SKIP_EXISTING: true |
0 commit comments