Skip to content

Commit

Permalink
after test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
huseyinbabal committed Oct 3, 2023
1 parent 2fd5493 commit 86ea383
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/branch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,24 @@ env:
IMAGE_TAG: v9.99.9-dev # TODO: Use commit hash tag to make the predictable builds for each commit on branch

jobs:
extract-metadata:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.extract-version.outputs.versions }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version
id: extract-version
run: |
IMAGE_VERSION=$(git rev-parse --short HEAD)
echo "versions={\"image-version\":[\"v9.99.9-dev\",\"0.0.0-${IMAGE_VERSION}\"]}" >> $GITHUB_OUTPUT
build:
needs: [extract-metadata]
strategy:
matrix: ${{ fromJson(needs.extract-metadata.outputs.versions) }}
runs-on: ubuntu-latest
env:
GO111MODULE: on
Expand Down Expand Up @@ -45,9 +62,12 @@ jobs:
install-only: true
version: latest
- name: Run GoReleaser
run: make release-snapshot
run: |
make release-snapshot
env:
ANALYTICS_API_KEY: ${{ secrets.ANALYTICS_API_KEY }}
GORELEASER_CURRENT_TAG: ${{ matrix.image-version }}
IMAGE_TAG: ${{ matrix.image-version }}
- name: Install Helm
uses: azure/setup-helm@v3
with:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/publish-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ jobs:
id: process-chart
run: |
SHA_SHORT="$(git rev-parse --short HEAD)"
CHART_VERSION="0.0.0-${SHA_SHORT}"
HELM_FOLDER=$(echo "${{ github.workspace }}/helm")
CHART_CURRENT_VERSION=$(sed -nE 's/^version\s*:\s*([^\s\/]*).*/\1/p' ${HELM_FOLDER}/botkube/Chart.yaml)
CHART_DEV_VERSION="v9.99.9-dev"
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_CURRENT_VERSION}/${SHA_SHORT}/g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_DEV_VERSION}/${SHA_SHORT}/g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s~${LATEST_PLUGIN_INDEX_URL}~https://github.com/kubeshop/botkube/releases/download/${{ inputs.next-version }}/plugins-index.yaml~g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s~${LATEST_X_PLUGIN_TPLS_URL}~github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=${{ inputs.next-version }}~g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_CURRENT_VERSION}/${CHART_VERSION}/g" {} +
find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_DEV_VERSION}/${CHART_VERSION}/g" {} +
echo "chart_version=$(echo $SHA_SHORT)" >> $GITHUB_OUTPUT
Expand All @@ -46,7 +45,7 @@ jobs:
- name: Publish Chart
run: |
helm package -d ${{ github.workspace }}/main-chart ./helm/botkube --version 0.0.0-${{ steps.process-chart.outputs.chart_version }}
helm package -d ${{ github.workspace }}/main-chart ./helm/botkube --version ${{ steps.process-chart.outputs.chart_version }}
helm repo index --url "${{ env.CHART_REPOSITORY }}" --merge ${{ github.workspace }}/main-chart/index.yaml ${{ github.workspace }}/main-chart/
- name: GCP auth
Expand All @@ -61,5 +60,5 @@ jobs:
uses: google-github-actions/upload-cloud-storage@v1
with:
path: ${{ github.workspace }}/main-chart
destination: 'dev-botkube-latest-main-charts/'
destination: 'botkube-latest-main-charts/'
parent: false
2 changes: 1 addition & 1 deletion hack/goreleaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ IMAGE_REPOSITORY="${IMAGE_REPOSITORY:-kubeshop/botkube}"
CFG_EXPORTER_IMAGE_REPOSITORY="${CFG_EXPORTER_IMAGE_REPOSITORY:-kubeshop/botkube-config-exporter}"
IMAGE_SAVE_LOAD_DIR="${IMAGE_SAVE_LOAD_DIR:-/tmp/botkube-images}"
IMAGE_PLATFORM="${IMAGE_PLATFORM:-linux/amd64}"
GORELEASER_CURRENT_TAG="${GORELEASER_CURRENT_TAG:-v9.99.9-dev}"

prepare() {
export DOCKER_CLI_EXPERIMENTAL="enabled"
Expand All @@ -16,7 +17,6 @@ prepare() {

release_snapshot() {
prepare
export GORELEASER_CURRENT_TAG=v9.99.9-dev
goreleaser release --clean --snapshot --skip-publish

# Push images
Expand Down

0 comments on commit 86ea383

Please sign in to comment.