-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
name: Force update helm chart | ||
|
||
# FIXME make this use release.yml | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Test and/or release helm chart | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
github-token: | ||
required: true | ||
inputs: | ||
tag: | ||
required: true | ||
type: string | ||
|
||
env: | ||
REPO: RocketChat/helm-charts | ||
|
||
jobs: | ||
can-chart-run: | ||
uses: ${{ env.REPO }}/.github/workflows/test.yml@master | ||
with: | ||
tag: ${{ inputs.tag }} | ||
|
||
update-release: | ||
needs: | ||
- can-chart-run | ||
if: ! contains(inputs.tag, 'rc') | ||
uses: ${{ env.REPO }}/.github/workflows/release.yml@master | ||
with: | ||
tag: ${{ inputs.tag }} | ||
secrets: | ||
github-token: ${{ secrets.github-token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: Release helm chart | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
github-token: | ||
required: true | ||
inputs: | ||
tag: | ||
type: string | ||
required: true | ||
|
||
env: | ||
REPO: 'RocketChat/helm-charts' | ||
|
||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone helm repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ env.REPO }} | ||
path: ./helm-charts | ||
token: ${{ secrets.github-token }} | ||
|
||
- name: Clone helm repo (gh-pages) | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ env.REPO }} | ||
ref: gh-pages | ||
path: ./gh-pages | ||
token: ${{ secrets.github-token }} | ||
|
||
- name: Update chart and rocketchat versions | ||
shell: bash | ||
id: version | ||
run: | | ||
sed -i -r '/^appVersion:/ s/ .+/ ${{ inputs.tag }}/' ./helm-charts/rocketchat/Chart.yaml | ||
sed -i -r '/^version:/ s/ .+/ ${{ inputs.tag }}/' ./helm-charts/rocketchat/Chart.yaml | ||
- name: Pull dependencies | ||
shell: bash | ||
run: helm dependency update ./helm-charts/rocketchat | ||
|
||
- name: Generate helm package | ||
shell: bash | ||
run: helm package ./helm-charts/rocketchat -d gh-pages/charts/ | ||
|
||
- name: Re-generate helm index | ||
run: helm repo index ./gh-pages/ | ||
|
||
- name: Push to master | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: "rocketchat/Chart.yaml" | ||
cwd: helm-charts | ||
message: "Chore: bump Rocket.Chat and chart version to ${{ inputs.tag }}" | ||
push: true | ||
|
||
- name: Push to gh-pages | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: "." | ||
cwd: gh-pages | ||
message: "Chore: bump Rocket.Chat and chart version to ${{ inputs.tag }}" | ||
push: true | ||
|
||
- name: Create a release with artifact | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ format('./gh-pages/charts/rocketchat-{0}.tgz', inputs.tag) }} | ||
prerelease: false | ||
repository: ${{ env.REPO }} | ||
token: ${{ secrets.github-token }} | ||
name: ${{ inputs.tag }} | ||
tag_name: ${{ inputs.tag }} | ||
body: ${{ format('https://github.com/RocketChat/Rocket.Chat/releases/{0}', inputs.tag) }} | ||
draft: false | ||
|
||
- name: Notify core team | ||
if: always() | ||
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master | ||
with: | ||
job_name: ${{ format('*Helm {0} release*', inputs.tag) }} | ||
url: ${{ secrets.rocketchat-webhook }} | ||
type: ${{ job.status }} | ||
mention: 'debdut.chakraborty' | ||
mention_if: failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test helm chart | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
tag: | ||
type: string | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
required: true | ||
|
||
env: | ||
REPO: 'RocketChat/helm-charts' | ||
TESTS_REPO: 'debdutdeb/rocket.chat.tests' | ||
|
||
|
||
jobs: | ||
can-i-run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone helm chart repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.REPO }} | ||
path: ./helm-charts | ||
- name: Clone tests | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ env.TESTS_REPO }} | ||
path: tests | ||
submodules: true | ||
- name: Setup k3d | ||
uses: nolar/setup-k3d-k3s@v1 | ||
- name: Run tests | ||
shell: bash | ||
env: | ||
ROCKETCHAT_MAX_ATTEMPTS: 250 | ||
ROCKETCHAT_TAG: ${{ inputs.tag }} | ||
run: | | ||
sudo apt-get install --no-install-recommends -y jo jq | ||
export ROCKETCHAT_CHART_DIR="$(realpath ./helm-charts/rocketchat)" | ||
cd tests && | ||
bash run_k8s.bash | ||