Skip to content

Commit

Permalink
add scoop installation
Browse files Browse the repository at this point in the history
  • Loading branch information
deepu105 committed May 19, 2021
1 parent 0fb6869 commit c7e8762
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ jobs:
git diff-index --quiet HEAD || git commit -am "Update package for KDash release ${{ env.RELEASE_VERSION }}"
git push origin main
- name: Execute Scoop packaging script
run: |
python "./deployment/scoop/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/scoop/kdash.json.template" "./kdash.json" ${{ env.WINDOWS_SHA }}
git config --global user.email "d4udts@gmail.com"
git config --global user.name "deepu105"
git clone https://deepu105:${{ secrets.CHOCO_GITHUB_TOKEN }}@github.com/kdash-rs/scoop-kdash --branch=main scoop
rm scoop/kdash.json
cp kdash.json scoop/kdash.json
cd scoop
git add .
git diff-index --quiet HEAD || git commit -am "Update package for KDash release ${{ env.RELEASE_VERSION }}"
git push origin main
publish-cargo:
name: Publishing to Cargo
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ To upgrade
brew upgrade kdash
```

### Scoop (Windows - Recommended)

```bash
scoop bucket add kdash-bucket https://github.com/kdash-rs/scoop-kdash

scoop install kdash
```

### Chocolatey (Windows)

Choco package located [here](https://chocolatey.org/packages/kdash).
Expand Down
25 changes: 25 additions & 0 deletions deployment/scoop/kdash.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"homepage": "https://github.com/kdash-rs/kdash",
"description": "A fast and simple dashboard for Kubernetes",
"version": "$version64",
"license": "MIT",
"architecture": {
"64bit": {
"url": "https://github.com/kdash-rs/kdash/releases/download/v$version64/kdash-windows.tar.gz",
"hash": "$hash_64"
}
},
"bin": "kdash.exe",
"checkver": "github",
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/kdash-rs/kdash/releases/download/v$version/kdash-windows.tar.gz",
"hash": {
"url": "https://github.com/kdash-rs/kdash/releases/download/v$version/kdash-windows.sha256",
"regex": "$sha256"
}
}
}
}
}
27 changes: 27 additions & 0 deletions deployment/scoop/packager.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import hashlib
import sys
from string import Template

args = sys.argv
version64 = args[1].replace("v", "")
template_file_path = args[2]
generated_file_path = args[3]

# Deployment files
hash_64 = args[4].strip()

print("Generating formula")
print(" VERSION: %s" % version64)
print(" TEMPLATE PATH: %s" % template_file_path)
print(" SAVING AT: %s" % generated_file_path)
print(" HASH: %s" % hash_64)

with open(template_file_path, "r") as template_file:
template = Template(template_file.read())
substitute = template.safe_substitute(version64=version64, hash_64=hash_64)
print("\n================== Generated package file ==================\n")
print(substitute)
print("\n============================================================\n")

with open(generated_file_path, "w") as generated_file:
generated_file.write(substitute)

0 comments on commit c7e8762

Please sign in to comment.