-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI to attach kubectl-vm binaries to Boot release page
- Loading branch information
1 parent
6d15cdd
commit 524ebaf
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/* | ||
.idea |
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
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 |