Skip to content

minor: revert remove static NFS PV #10

minor: revert remove static NFS PV

minor: revert remove static NFS PV #10

Workflow file for this run

name: pre-release helm chart
on:
pull_request:
types:
- closed
env:
HELM_VERSION: v3.15.2
jobs:
pre-release:
if: github.event.pull_request.merged == true || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}
- name: determine version increment
id: determine-version
run: |
PR_TITLE=$(echo "${{ github.event.pull_request.title }}" | tr '[:upper:]' '[:lower:]')
if [[ "$PR_TITLE" =~ "major:" ]]; then
echo "version_type=major" >> $GITHUB_ENV
elif [[ "$PR_TITLE" =~ "minor:" ]]; then
echo "version_type=minor" >> $GITHUB_ENV
else
echo "version_type=patch" >> $GITHUB_ENV
fi
echo "Version increment type: ${{ env.version_type }}"
- name: install yq
uses: mikefarah/yq@master
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
- name: bump chart versions
id: bump-version
run: |
cd helm-chart/eoapi
VERSION_TYPE=${{ env.version_type }}
CURRENT_VERSION=$(grep '^version:' Chart.yaml | awk '{print $2}')
# strip double quotes
CURRENT_VERSION=${CURRENT_VERSION#\"}
CURRENT_VERSION=${CURRENT_VERSION%\"}
CURRENT_APP_VERSION=$(grep '^appVersion:' Chart.yaml | awk '{print $2}')
# strip double quotes
CURRENT_APP_VERSION=${CURRENT_APP_VERSION#\"}
CURRENT_APP_VERSION=${CURRENT_APP_VERSION%\"}
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
IFS='.' read -r -a APP_VERSION_PARTS <<< "$CURRENT_APP_VERSION"
if [[ "$VERSION_TYPE" == "major" ]]; then
NEW_VERSION="$((VERSION_PARTS[0] + 1)).0.0"
# appVersion does not need to follow semvar
NEW_APP_VERSION="${APP_VERSION_PARTS[0]}.${APP_VERSION_PARTS[1]}.$((APP_VERSION_PARTS[2] + 1))"
elif [[ "$VERSION_TYPE" == "minor" ]]; then
NEW_VERSION="${VERSION_PARTS[0]}.$((VERSION_PARTS[1] + 1)).0"
# appVersion does not need to follow semvar
NEW_APP_VERSION="${APP_VERSION_PARTS[0]}.${APP_VERSION_PARTS[1]}.$((APP_VERSION_PARTS[2] + 1))"
else
NEW_VERSION="${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.$((VERSION_PARTS[2] + 1))"
# appVersion does not need to follow semvar
NEW_APP_VERSION="${APP_VERSION_PARTS[0]}.${APP_VERSION_PARTS[1]}.$((APP_VERSION_PARTS[2] + 1))"
fi
yq -i '.version = strenv(NEW_VERSION)' Chart.yaml
yq -i '.appVersion = strenv(NEW_APP_VERSION)' Chart.yaml
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
echo "New version: $NEW_VERSION"
echo "New app version: $NEW_APP_VERSION"
- name: commit and tag version bump
run: |
COMMIT_MSG="release version to ${{ env.new_version }}"
TAG="v${{ env.new_version }}"
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git commit -am $COMMIT_MSG
git tag $TAG
git push origin main --tags
- name: create github release (triggers release)
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ env.new_version }}"
release_name: "v${{ env.new_version }}"
body: |
## Changes in this Release
- Auto-generated release based on PR merge.