Skip to content

Upgrade controller-runtime, k8s dependencies and switch leader elec… #89

Upgrade controller-runtime, k8s dependencies and switch leader elec…

Upgrade controller-runtime, k8s dependencies and switch leader elec… #89

Workflow file for this run

name: Release
env:
GO_VERSION: 1.21
on:
push:
branches:
- "v[0-9]+.[0-9]+"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
jobs:
build-linux-binary:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: gcc install
run: sudo apt-get update; sudo apt install gcc-aarch64-linux-gnu
- name: Get tag
uses: little-core-labs/get-git-tag@v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Get Latest Release
id: latest_version
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: ${{ github.repository_owner }}
repo: extendeddaemonset
excludes: prerelease, draft
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --skip-publish --config .goreleaser-for-linux.yaml
env:
GORELEASER_PREVIOUS_TAG: ${{steps.latest_version.outputs.release}}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: kubectl-eds-linux
path: |
dist/kubectl-eds_*.zip
dist/checksums.txt
dist/CHANGELOG.md
build-darwin-binary:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get tag
uses: little-core-labs/get-git-tag@v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Get Latest Release
id: latest_version
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: ${{ github.repository_owner }}
repo: extendeddaemonset
excludes: prerelease, draft
- name: Build
uses: goreleaser/goreleaser-action@v3
with:
args: release --skip-publish --config .goreleaser-for-darwin.yaml
env:
GORELEASER_PREVIOUS_TAG: ${{steps.latest_version.outputs.release}}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: kubectl-eds-darwin
path: |
dist/kubectl-eds_*.zip
dist/checksums.txt
build-windows-binary:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get tag
uses: little-core-labs/get-git-tag@v3.0.2
id: tag
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Get Latest Release
id: latest_version
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: ${{ github.repository_owner }}
repo: extendeddaemonset
excludes: prerelease, draft
- name: Build
uses: goreleaser/goreleaser-action@v3
with:
args: release --skip-publish --config .goreleaser-for-windows.yaml
env:
GORELEASER_PREVIOUS_TAG: ${{steps.latest_version.outputs.release}}
- name: Upload
uses: actions/upload-artifact@v3
with:
name: kubectl-eds-windows
path: |
dist/kubectl-eds_*.zip
dist/checksums.txt
create-release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build-linux-binary, build-darwin-binary, build-windows-binary]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Make directories
run: |
mkdir -p ./dist/linux
mkdir -p ./dist/darwin
mkdir -p ./dist/windows
- name: Download linux binaries
uses: actions/download-artifact@v3
with:
name: kubectl-eds-linux
path: ./tmp-build/linux
- name: Download darwin binaries
uses: actions/download-artifact@v3
with:
name: kubectl-eds-darwin
path: ./tmp-build/darwin
- name: Download windows binaries
uses: actions/download-artifact@v3
with:
name: kubectl-eds-windows
path: ./tmp-build/windows
- name: Get tag
uses: little-core-labs/get-git-tag@v3.0.2
id: tag
- name: Prepare ./dist folder
run: |
mkdir -p ./dist
cat ./tmp-build/darwin/checksums.txt >> ./dist/checksums.txt
cat ./tmp-build/linux/checksums.txt >> ./dist/checksums.txt
cat ./tmp-build/windows/checksums.txt >> ./dist/checksums.txt
cat ./tmp-build/linux/CHANGELOG.md >> ./dist/CHANGELOG.md
mv ./tmp-build/darwin/*.zip ./dist
mv ./tmp-build/linux/*.zip ./dist
mv ./tmp-build/windows/*.zip ./dist
- name: Generate Plugin manifest
run: ./hack/release/generate-plugin-manifest.sh ${{steps.tag.outputs.tag}}
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: dist/CHANGELOG.md
prerelease: ${{ contains(github.ref, '-rc.') }}
files: |
dist/eds-plugin.yaml
dist/*.zip
dist/*.tar.gz
dist/checksums.txt
env:
COMMIT_TAG: ${{steps.tag.outputs.tag}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update new plugin version in krew-index
uses: rajatjindal/krew-release-bot@v0.0.43
continue-on-error: true
with:
krew_template_file: dist/eds-plugin.yaml