Skip to content

Commit

Permalink
CI to attach kubectl-vm binaries to Boot release page
Browse files Browse the repository at this point in the history
  • Loading branch information
vania-pooh committed Sep 20, 2023
1 parent 6d15cdd commit 524ebaf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: release

on:
release:
types: [published]

jobs:
moon:
runs-on: ubuntu-latest
if: github.repository == 'aerokube/boot'
steps:
- uses: actions/checkout@v3

- name: Prepare release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV

- name: Download and extract release
run: ci/extract.sh $RELEASE_VERSION

- uses: AButler/[email protected]
with:
files: 'dist/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/*
.idea
19 changes: 19 additions & 0 deletions ci/extract.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -e

VERSION=$1

mkdir -p dist
cd dist
for osArch in "linux/amd64" "darwin/amd64" "darwin/arm64" "windows/amd64"; do
os=$(echo "$osArch" | awk -F "_" '{print $1;}')
arch=$(echo "$osArch" | awk -F "_" '{print $2;}')
zipFile='kubectl-vm_'"$VERSION"'_'"$osArch.zip"
downloadURL="https://download.aerokube.com/boot/kubectl-vm/$VERSION/$zipFile"
outputFile='kubectl-vm_'"$os"'_'"$arch"
if [ "$os" == "windows" ]; then
outputFile="$outputFile.exe"
fi
curl -s "$downloadURL" | zcat >> "$outputFile"
chmod 755 "$outputFile"
done

0 comments on commit 524ebaf

Please sign in to comment.