diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 60e5bbe..1f8052b 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -56,14 +56,12 @@ jobs: - name: Set up Cluster run: | kubectl cluster-info - kubectl apply -f deploy/crds mkdir -p .local echo "${{ secrets.SECRET_KUBERNETES_RESOURCES }}" | base64 --decode > .local/test-config.yaml - name: Make Install & Verify run: | make install - make verify - name: Test run: make test diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 8b32016..dbe71ab 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -8,7 +8,6 @@ on: env: DOCKER_FILE_PATH: build/Dockerfile GOLANG_VERSION: 1.15.2 - OPERATOR_SDK_VERSION: "0.15.2" KUBERNETES_VERSION: "1.18.0" KIND_VERSION: "0.7.0" HELM_REGISTRY_URL: "https://stakater.github.io/stakater-charts" @@ -62,7 +61,6 @@ jobs: - name: Set up Cluster run: | kubectl cluster-info - kubectl apply -f deploy/crds mkdir -p .local echo "${{ secrets.SECRET_KUBERNETES_RESOURCES }}" | base64 --decode > .local/test-config.yaml @@ -75,7 +73,6 @@ jobs: - name: Make Install & Verify run: | make install - make verify - name: Test run: make test @@ -133,45 +130,26 @@ jobs: DEFAULT_BUMP: patch DRY_RUN: true - # Install operator-sdk - - name: Install operator-sdk - env: - OPERATOR_SDK_VERSION: ${{ env.OPERATOR_SDK_VERSION }} - run: | - curl -fL -o /tmp/operator-sdk "https://github.com/operator-framework/operator-sdk/releases/download/v${OPERATOR_SDK_VERSION}/operator-sdk-v${OPERATOR_SDK_VERSION}-x86_64-linux-gnu" - sudo install /tmp/operator-sdk /usr/local/bin && rm -f /tmp/operator-sdk - operator-sdk version - operator-sdk version | grep -q "${OPERATOR_SDK_VERSION}" - - # Install Kustomize - - uses: imranismail/setup-kustomize@v1 - with: - kustomize-version: ${{ env.KUSTOMIZE_VERSION }} - - # - name: Generate Bundle - # env: - # VERSION: ${{ steps.generate_operator_tag.outputs.new_tag }} - # run: make bundle - # Update chart tag to the latest semver tag - name: Update Chart Version env: VERSION: ${{ steps.generate_operator_tag.outputs.new_tag }} run: make bump-chart - - # - name: Update Chart CRDs - # run: make generate-crds - - # Setting up helm binary - - uses: azure/setup-helm@v1 - # Publish helm chart to + # Publish helm chart - name: Publish Helm chart - run: | - helm plugin install https://github.com/chartmuseum/helm-push.git - helm package deployments/kubernetes/chart/reloader/* --destination ./packaged-chart - helm push ./packaged-chart/*.tgz ${{ env.HELM_REGISTRY_URL }} - # curl ${{ env.HELM_REGISTRY_URL }} --upload-file ./packaged-chart/*.tgz + uses: stefanprodan/helm-gh-pages@master + with: + branch: master + repository: stakater-charts + target_dir: docs + token: ${{ secrets.STAKATER_GITHUB_TOKEN }} + charts_dir: charts + charts_url: ${{ env.HELM_REGISTRY_URL }} + owner: stakater + linting: off + commit_username: stakater-user + commit_email: stakater@gmail.com # Commit back changes - name: Commit files diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index db43c57..0da449f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,39 +1,44 @@ -name: Release +name: Release Go project on: push: tags: - "v*" +env: + GOLANG_VERSION: 1.15.2 + jobs: - release: + build: + name: GoReleaser build runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v2 with: - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token - fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + fetch-depth: 0 # See: https://goreleaser.com/ci/actions/ - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Go 1.x + uses: actions/setup-go@v2 with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - # body: - draft: false - prerelease: false + go-version: ${{ env.GOLANG_VERSION }} + id: go + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@master + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} - name: Notify Slack uses: 8398a7/action-slack@v3 - if: always() # Pick up events even if the job fails or is canceled. + if: always() with: status: ${{ job.status }} fields: repo,author,action,eventName,ref,workflow env: GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} \ No newline at end of file diff --git a/Makefile b/Makefile index 4cf1cc4..6c779e3 100644 --- a/Makefile +++ b/Makefile @@ -50,27 +50,8 @@ apply: deploy: binary-image push apply -# find or download controller-gen -# download controller-gen if necessary -controller-gen: -ifeq (, $(shell which controller-gen)) - @{ \ - set -e ;\ - CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\ - cd $$CONTROLLER_GEN_TMP_DIR ;\ - go mod init tmp ;\ - go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.3.0 ;\ - rm -rf $$CONTROLLER_GEN_TMP_DIR ;\ - } -CONTROLLER_GEN=$(GOBIN)/controller-gen -else -CONTROLLER_GEN=$(shell which controller-gen) -endif - -bump-chart-operator: +# Bump Chart +bump-chart: sed -i "s/^version:.*/version: $(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml sed -i "s/^appVersion:.*/appVersion: $(VERSION)/" deployments/kubernetes/chart/reloader/Chart.yaml sed -i "s/tag:.*/tag: v$(VERSION)/" deployments/kubernetes/chart/reloader/values.yaml - -# Bump Chart -bump-chart: bump-chart-operator