Skip to content

Merge pull request #2 from roshan-vijayan-ibm/main #3

Merge pull request #2 from roshan-vijayan-ibm/main

Merge pull request #2 from roshan-vijayan-ibm/main #3

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Push events to matching semver, i.e. 1.0.0
name: Build and create release
jobs:
build:
name: Build and upload release binary
#if: github.event.base_ref == 'refs/heads/master' # only run if on master branch
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Read Helm Chart
id: chart
uses: jacobtomlinson/gha-read-helm-chart@master
with:
path: ibm-connectivity-pack
- name: Print Chart Details and set Chart Version
run: |
echo "Name - ${{ steps.chart.outputs.name }}"
echo "Version - ${{ steps.chart.outputs.version }}"
echo "App Version - ${{ steps.chart.outputs.appVersion }}"
echo "CHART_VERSION=${{ steps.chart.outputs.version }}" >> $GITHUB_ENV
- name: Package Helm Chart
run: tar -czvf ibm-connectivity-pack-${{env.CHART_VERSION}}.tgz -C ibm-connectivity-pack .
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset Helm Chart
id: upload-release-asset-helm-chart
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ibm-connectivity-pack-${{env.CHART_VERSION}}.tgz
asset_name: ibm-connectivity-pack-${{env.CHART_VERSION}}.tgz
asset_content_type: application/tgz