release v1.13.0-rc.2 (#1739) #586
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: | |
branches: | |
- "v[0-9]+.[0-9]+" | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" | |
# Permission forced by repo-level setting; only elevate on job-level | |
permissions: | |
contents: read | |
# packages: read | |
env: | |
GO_VERSION: 1.23.6 | |
jobs: | |
build-linux-binary: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
# https://github.com/marketplace/actions/goreleaser-action | |
contents: write | |
# actions/upload-artifact | |
actions: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
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@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2 | |
id: tag | |
- name: Set up Go | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Get Latest Release | |
id: latest_version | |
uses: pozetroninc/github-action-get-latest-release@53d33d213ee71c72360e3c829caf7cee94ec21e2 # master | |
with: | |
owner: ${{ github.repository_owner }} | |
repo: datadog-operator | |
excludes: prerelease, draft | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0 | |
with: | |
version: 2.4.1 | |
args: release --skip=publish --config .goreleaser-for-linux.yaml | |
env: | |
GORELEASER_PREVIOUS_TAG: ${{steps.latest_version.outputs.release}} | |
- name: Upload | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
with: | |
name: kubectl-datadog-linux | |
path: | | |
dist/kubectl-datadog_*.zip | |
dist/checksums.txt | |
dist/CHANGELOG.md | |
build-darwin-binary: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: macos-latest | |
permissions: | |
# https://github.com/marketplace/actions/goreleaser-action | |
contents: write | |
# actions/upload-artifact | |
actions: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Get tag | |
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2 | |
id: tag | |
- name: Set up Go | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Get Latest Release | |
id: latest_version | |
uses: pozetroninc/github-action-get-latest-release@53d33d213ee71c72360e3c829caf7cee94ec21e2 # master | |
with: | |
owner: ${{ github.repository_owner }} | |
repo: datadog-operator | |
excludes: prerelease, draft | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0 | |
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@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
with: | |
name: kubectl-datadog-darwin | |
path: | | |
dist/kubectl-datadog_*.zip | |
dist/checksums.txt | |
build-windows-binary: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
# https://github.com/marketplace/actions/goreleaser-action | |
contents: write | |
# actions/upload-artifact | |
actions: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Get tag | |
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # v3.0.2 | |
id: tag | |
- name: Set up Go | |
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Get Latest Release | |
id: latest_version | |
uses: pozetroninc/github-action-get-latest-release@53d33d213ee71c72360e3c829caf7cee94ec21e2 # master | |
with: | |
owner: ${{ github.repository_owner }} | |
repo: datadog-operator | |
excludes: prerelease, draft | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0 | |
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@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
with: | |
name: kubectl-datadog-windows | |
path: | | |
dist/kubectl-datadog_*.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 | |
permissions: | |
# https://github.com/marketplace/actions/goreleaser-action | |
# https://github.com/softprops/action-gh-release?tab=readme-ov-file#permissions | |
contents: write | |
# actions/download-artifact | |
actions: read | |
# rajatjindal/[email protected] | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
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@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: kubectl-datadog-linux | |
path: ./tmp-build/linux | |
- name: Download darwin binaries | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: kubectl-datadog-darwin | |
path: ./tmp-build/darwin | |
- name: Download windows binaries | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: kubectl-datadog-windows | |
path: ./tmp-build/windows | |
- name: Get tag | |
uses: little-core-labs/get-git-tag@2c292ff564c1a61b989e29f0410d131317f89b03 # 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 | |
cp ./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@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v1.0.0 | |
with: | |
body_path: dist/CHANGELOG.md | |
prerelease: ${{ contains(github.ref, '-rc.') }} | |
files: | | |
dist/datadog-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@3d9faef30a82761d610544f62afddca00993eef9 # v0.0.47 | |
continue-on-error: true | |
with: | |
krew_template_file: dist/datadog-plugin.yaml |