Skip to content

Commit

Permalink
OPSEXP-1796 Release with a workflow triggered by tag (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn authored Nov 16, 2022
1 parent e017f5a commit a1c2663
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 38 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/helm-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,41 +101,3 @@ jobs:
quay_password: ${{ secrets.QUAY_PASSWORD }}
acm_certificate: ${{ secrets.ACM_CERTIFICATE }}
aws_sg: ${{ secrets.AWS_SG }}
publish:
runs-on: ubuntu-latest
needs:
- build_vars
strategy:
max-parallel: 1
matrix:
charts: ${{ fromJSON(needs.build_vars.outputs.chart_names) }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: >-
Alfresco/alfresco-build-tools/.github/actions/get-commit-message@v1.21.0
- uses: >-
Alfresco/alfresco-build-tools/.github/actions/get-branch-name@v1.21.0
- name: Set release type to stable when requested
if: github.ref_name == github.event.repository.default_branch
run: |
if [[ "$COMMIT_MESSAGE" =~ ^.*\[release\].*$ ]]; then
echo "RELEASE_TYPE=stable" >> $GITHUB_ENV
fi
- name: Set release type to incubator when requested
run: |
if [[ "$COMMIT_MESSAGE" =~ ^.*\[publish\].*$ ]]; then
echo "RELEASE_TYPE=incubator" >> $GITHUB_ENV
fi
- name: Publish chart
if: env.RELEASE_TYPE == 'stable' || env.RELEASE_TYPE == 'incubator'
uses: >-
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/publish-chart@v1.21.0
with:
chart_name: ${{ matrix.charts }}
chart_repo: Alfresco/acs-deployment.git
release_type: ${{ env.RELEASE_TYPE }}
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
github_username: ${{ secrets.BOT_GITHUB_USERNAME }}
github_email: ${{ secrets.BOT_GITHUB_EMAIL }}
50 changes: 50 additions & 0 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Helm release

on:
push:
tags:
- v**

jobs:
build_vars:
runs-on: ubuntu-latest
outputs:
app_json: ${{ steps.getcharts.outputs.app }}
chart_names: ${{ steps.chart_names.outputs.json}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: getcharts
uses: ./.github/actions/charts-as-json
with:
charts-root: helm
- id: chart_names
env:
JSON: ${{ toJSON(fromJSON(steps.getcharts.outputs.all)) }}
JQ_FILTER: $json | [.charts[].name]
run: |
CHARTS=$(jq -nc --argjson json '${{ env.JSON }}' '${{ env.JQ_FILTER }}')
echo "json=$CHARTS" >> $GITHUB_OUTPUT
publish:
runs-on: ubuntu-latest
needs:
- build_vars
strategy:
max-parallel: 1
fail-fast: true
matrix:
charts: ${{ fromJSON(needs.build_vars.outputs.chart_names) }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Publish chart
uses: >-
Alfresco/alfresco-build-tools/.github/actions/dbp-charts/publish-chart@88063ae20fa0f16ff559f34b8440592eb4c67e7e
with:
chart_name: ${{ matrix.charts }}
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
github_username: ${{ secrets.BOT_GITHUB_USERNAME }}
github_email: ${{ secrets.BOT_GITHUB_EMAIL }}

0 comments on commit a1c2663

Please sign in to comment.