Skip to content

Commit 8ff3607

Browse files
authored
Merge pull request #227 from aalves08/update-release-procedure
update release procedure to use reusable workflow
2 parents f865af5 + 93ecbad commit 8ff3607

File tree

1 file changed

+5
-105
lines changed

1 file changed

+5
-105
lines changed

.github/workflows/build-extension-charts.yml

Lines changed: 5 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -5,120 +5,20 @@ on:
55
release:
66
types: [released]
77

8-
env:
9-
ACTIONS_RUNNER_DEBUG: false
10-
CI_COMMIT_MESSAGE: CI Build Artifacts
11-
TARGET_BRANCH: gh-pages
12-
138
defaults:
149
run:
1510
shell: bash
1611
working-directory: ./
1712

1813
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
9116
permissions:
9217
actions: write
9318
contents: write
9419
deployments: write
9520
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 }}
11724

118-
- name: Run chart-releaser
119-
uses: helm/[email protected]
120-
with:
121-
charts_dir: ./charts/*
122-
env:
123-
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
124-
CR_SKIP_EXISTING: true

0 commit comments

Comments
 (0)