Skip to content

Maded changes on actions to automate release process #3

Maded changes on actions to automate release process

Maded changes on actions to automate release process #3

name: EA Branch Automation
on:
create:
push:
branches:
- '**-EA'
jobs:
package-and-index:
runs-on: ubuntu-latest
if: endsWith(github.ref_name, '-EA') && (github.event_name == 'create' || github.event_name == 'push')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: 'latest'
- name: Extract branch name
id: extract_branch
run: |
BRANCH_NAME="${{ github.ref_name }}"
echo "branch_name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
echo "Branch name: ${BRANCH_NAME}"
- name: Generate versions.yaml and raw_images_list.txt
run: |
.github/workflows/scripts/generate-ea-files.sh
echo "Generated files:"
echo "versions.yaml:"
cat versions.yaml
echo ""
echo "raw_images_list.txt:"
cat raw_images_list.txt
- name: Package px-central chart
run: |
cd stable
helm package ../charts/px-central
echo "Packaged chart created:"
ls -lh px-central-*.tgz | tail -1
- name: Update Helm repo index
run: |
cd stable
BRANCH_NAME="${{ steps.extract_branch.outputs.branch_name }}"
helm repo index --url "https://raw.githubusercontent.com/portworx/helm/${BRANCH_NAME}/stable/" .
echo "Index updated with URL: https://raw.githubusercontent.com/portworx/helm/${BRANCH_NAME}/stable/"
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and push changes
run: |
git add stable/*.tgz stable/index.yaml versions.yaml raw_images_list.txt
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Auto-package px-central chart for ${{ steps.extract_branch.outputs.branch_name }}"
git push origin ${{ github.ref_name }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}