Bump dependencies to use latest x-net and grpc libraries (#42) #22
Workflow file for this run
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
name: Release | |
on: | |
push: | |
# Build and publish artifacts for a release | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
uses: ./.github/workflows/build-n-push.yaml | |
with: | |
IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY }} | |
secrets: inherit | |
image-publish: | |
name: Tag image with release tag and push to repo | |
# if: github.event.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: ["build"] | |
env: | |
IMAGE_PATH: ${{ needs.build.outputs.IMAGE_PATH }} | |
outputs: | |
PROVIDER_IMAGE_REPO: ${{ env.PROVIDER_IMAGE_REPO }} | |
PROVIDER_IMAGE_NEW_TAG: ${{ env.PROVIDER_IMAGE_NEW_TAG }} | |
steps: | |
- name: Log into GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin | |
- name: split image path into repo and tag | |
id: split-image-path | |
run: | | |
echo PROVIDER_IMAGE_REPO=`echo ${{ env.IMAGE_PATH }} | sed -e "s/:.*$//"` >> $GITHUB_ENV | |
echo PROVIDER_IMAGE_NEW_TAG=${{ github.ref_name }} >> $GITHUB_ENV | |
- name: tag Image with release name | |
run: | | |
docker pull ${{ env.IMAGE_PATH }} | |
docker tag ${{ env.IMAGE_PATH }} ${{ env.PROVIDER_IMAGE_REPO }}:${{ env.PROVIDER_IMAGE_NEW_TAG }} | |
docker push ${{ env.PROVIDER_IMAGE_REPO }}:${{ env.PROVIDER_IMAGE_NEW_TAG }} | |
charts-publish: | |
runs-on: ubuntu-latest | |
needs: ["build", "image-publish"] | |
env: | |
IMAGE_PATH : ${{ needs.build.outputs.IMAGE_PATH }} | |
PROVIDER_IMAGE_REPO: ${{ needs.image-publish.outputs.PROVIDER_IMAGE_REPO }} | |
PROVIDER_IMAGE_NEW_TAG: ${{ needs.image-publish.outputs.PROVIDER_IMAGE_NEW_TAG }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.3.0 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: helm release | |
run: | | |
git checkout gh-pages | |
git checkout origin/main charts | |
sed -i -e 's|repository:.*|repository: ${{ env.PROVIDER_IMAGE_REPO }}|' \ | |
-e 's|tag:.*|tag: ${{ env.PROVIDER_IMAGE_NEW_TAG }}|' \ | |
charts/oci-secrets-store-csi-driver-provider/values.yaml | |
helm package charts/oci-secrets-store-csi-driver-provider -d charts | |
# mkdir temp-charts | |
helm repo index --url ${{ vars.HELM_CHARTS_REPO }}/charts --merge charts/index.yaml charts | |
# mv temp-charts/index.yaml charts/index.yaml | |
git add charts | |
git commit -m "Releasing version: ${{ github.ref_name }}" | |
git push -u origin gh-pages | |
- name: verify published chart version | |
run: | | |
helm repo add oci-provider ${{ vars.HELM_CHARTS_REPO }}/charts | |
helm repo update oci-provider | |
PUBLISHED_CHART_VERSION=`helm search repo oci-provider/oci-secrets-store-csi-driver-provider | grep ^oci | awk '{print $2}'` | |
LOCAL_CHART_VERSION=`grep "^version: " charts/oci-secrets-store-csi-driver-provider/Chart.yaml | sed -e "s/version: //"` | |
echo "PUBLISHED_CHART_VERSION=$PUBLISHED_CHART_VERSION" | |
echo "LOCAL_CHART_VERSION=$LOCAL_CHART_VERSION" | |
if [ "${PUBLISHED_CHART_VERSION}" != "${LOCAL_CHART_VERSION}" ]; | |
then | |
echo "published version and local versions are not matching" | |
exit 1 | |
else | |
echo "published version and local versions are matching" | |
fi | |
# charts-deploy: | |
# runs-on: ubuntu-latest | |
# needs: [ "charts-publish"] | |
# steps: | |
# - name: Create k8s Kind Cluster | |
# uses: helm/kind-action@v1.4.0 | |
# - name: get nodes | |
# run: kubectl get nodes | |
# - name: deploy helm chart | |
# run: | | |
# helm repo add oci-provider ${{ vars.HELM_CHARTS_REPO }}/charts | |
# helm install oci-provider oci-provider/oci-secrets-store-csi-driver-provider -n kube-system | |
# kubectl get daemonset -n kube-system \ | |
# --selector='app.kubernetes.io/name in (oci-secrets-store-csi-driver-provider, secrets-store-csi-driver)' |