Skip to content

Commit

Permalink
ci/cd updates
Browse files Browse the repository at this point in the history
  • Loading branch information
deepu105 committed Jan 10, 2024
1 parent c29d65d commit 10c3e8d
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 161 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ If applicable, add screenshots to help explain your problem.
- OS and OS version: [e.g. macOS 10.1 / Fedora 34 / WIndows 10]
- Terminal name and version [e.g. Tilix, Yakuake, Gnome Terminal, Konsole, iTerm, Windows CMD]
- Shell name and version [e.g. bash, zsh, fish, powershell]
- Kubectl Client Version [e.g. 1.19]
- Kubectl Server Version [e.g. 1.19]
- jwt-ui version [e.g. 0.0.8]

**Additional context**
Expand Down
47 changes: 14 additions & 33 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
- { os: "windows-latest", target: "x86_64-pc-windows-msvc", artifact_prefix: "windows" }
- { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", artifact_prefix: "linux", }
- { os: "ubuntu-latest", target: "x86_64-unknown-linux-musl", artifact_prefix: "linux-musl", }
- { os: "ubuntu-latest", target: "aarch64-unknown-linux-gnu", artifact_prefix: "aarch64-gnu", use-cross: true, test-bin: "--bin jwt-ui" }
- { os: "ubuntu-latest", target: "aarch64-unknown-linux-musl", artifact_prefix: "aarch64-musl", use-cross: true, test-bin: "--bin jwt-ui" }
- { os: "ubuntu-latest", target: "arm-unknown-linux-gnueabihf", artifact_prefix: "arm-gnu", use-cross: true, test-bin: "--bin jwt-ui" }
- { os: "ubuntu-latest", target: "arm-unknown-linux-musleabihf", artifact_prefix: "arm-musl", use-cross: true, test-bin: "--bin jwt-ui" }
- { os: "ubuntu-latest", target: "aarch64-unknown-linux-gnu", artifact_prefix: "aarch64-gnu", use-cross: true, test-bin: "--bin jwtui" }
- { os: "ubuntu-latest", target: "aarch64-unknown-linux-musl", artifact_prefix: "aarch64-musl", use-cross: true, test-bin: "--bin jwtui" }
- { os: "ubuntu-latest", target: "arm-unknown-linux-gnueabihf", artifact_prefix: "arm-gnu", use-cross: true, test-bin: "--bin jwtui" }
- { os: "ubuntu-latest", target: "arm-unknown-linux-musleabihf", artifact_prefix: "arm-musl", use-cross: true, test-bin: "--bin jwtui" }

steps:
- name: Checkout repository
Expand Down Expand Up @@ -121,10 +121,10 @@ jobs:
shell: bash
run: |
cd target/${{ matrix.job.target }}/release
BINARY_NAME=jwt-ui.exe
BINARY_NAME=jwtui.exe
# strip the binary
strip $BINARY_NAME
RELEASE_NAME=jwt-ui-${{ matrix.job.artifact_prefix }}
RELEASE_NAME=jwtui-${{ matrix.job.artifact_prefix }}
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
# create sha checksum files
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
Expand All @@ -141,10 +141,10 @@ jobs:
aarch64-*-linux-*) STRIP="aarch64-linux-gnu-strip" ;;
esac;
cd target/${{ matrix.job.target }}/release
BINARY_NAME=jwt-ui
BINARY_NAME=jwtui
# strip the binary
"$STRIP" "$BINARY_NAME"
RELEASE_NAME=jwt-ui-${{ matrix.job.artifact_prefix }}
RELEASE_NAME=jwtui-${{ matrix.job.artifact_prefix }}
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
# create sha checksum files
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
Expand All @@ -171,7 +171,7 @@ jobs:

publish-package-formula:
needs: [build-release]
name: Update homebrew & choco formulas
name: Update homebrew & scoop formulas
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -188,11 +188,11 @@ jobs:
- name: Set release assets and version
shell: bash
run: |
macos_sha="$(cat ./artifacts/jwt-ui-macos.sha256 | awk '{print $1}')"
macos_sha="$(cat ./artifacts/jwtui-macos.sha256 | awk '{print $1}')"
echo "MACOS_SHA=$macos_sha" >> $GITHUB_ENV
linux_sha="$(cat ./artifacts/jwt-ui-linux.sha256 | awk '{print $1}')"
linux_sha="$(cat ./artifacts/jwtui-linux.sha256 | awk '{print $1}')"
echo "LINUX_SHA=$linux_sha" >> $GITHUB_ENV
windows_sha="$(cat ./artifacts/jwt-ui-windows.sha256 | awk '{print $1}')"
windows_sha="$(cat ./artifacts/jwtui-windows.sha256 | awk '{print $1}')"
echo "WINDOWS_SHA=$windows_sha" >> $GITHUB_ENV
release_version="$(cat ./artifacts/release-version)"
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
Expand All @@ -212,33 +212,14 @@ jobs:
# push to Git
git config --global user.email "d4udts@gmail.com"
git config --global user.name "deepu105"
git clone https://deepu105:${{ secrets.TAP_GITHUB_TOKEN }}@github.com/jwt-rs/homebrew-jwt-ui.git --branch=main brew
git clone https://deepu105:${{ secrets.BREWTAP_GITHUB_TOKEN }}@github.com/jwt-rs/homebrew-jwt-ui.git --branch=main brew
rm brew/Formula/jwt-ui.rb
cp jwt-ui.rb brew/Formula
cd brew
git add .
git diff-index --quiet HEAD || git commit -am "Update formula for jwt-ui release ${{ env.RELEASE_VERSION }}"
git push origin main
- name: Execute chocolatey packaging script
run: |
# run packaging script
python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/jwt-ui.nuspec.template" "./jwt-ui.nuspec" ${{ env.WINDOWS_SHA }}
python "./deployment/chocolatey/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/chocolatey/chocolateyinstall.ps1.template" "./chocolateyinstall.ps1" ${{ env.WINDOWS_SHA }}
# push to Git
git config --global user.email "d4udts@gmail.com"
git config --global user.name "deepu105"
git clone https://deepu105:${{ secrets.CHOCO_GITHUB_TOKEN }}@github.com/jwt-rs/choco-jwt-ui --branch=main choco
rm choco/jwt-ui.nuspec
rm choco/tools/chocolateyinstall.ps1
cp jwt-ui.nuspec choco/jwt-ui.nuspec
cp chocolateyinstall.ps1 choco/tools/chocolateyinstall.ps1
cd choco
git add .
git diff-index --quiet HEAD || git commit -am "Update package for jwt-ui release ${{ env.RELEASE_VERSION }}"
git push origin main
- name: Execute Scoop packaging script
run: |
# run packaging script
Expand All @@ -247,7 +228,7 @@ jobs:
# push to Git
git config --global user.email "d4udts@gmail.com"
git config --global user.name "deepu105"
git clone https://deepu105:${{ secrets.CHOCO_GITHUB_TOKEN }}@github.com/jwt-rs/scoop-jwt-ui --branch=main scoop
git clone https://deepu105:${{ secrets.SCOOP_GITHUB_TOKEN }}@github.com/jwt-rs/scoop-jwt-ui --branch=main scoop
rm scoop/jwt-ui.json
cp jwt-ui.json scoop/jwt-ui.json
cd scoop
Expand Down
20 changes: 10 additions & 10 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@
"version": "0.2.0",
"configurations": [
{
"name": "Windows - Debug executable 'jwt-ui'",
"name": "Windows - Debug executable 'jwtui'",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}\\target\\debug\\jwt-ui.exe",
"program": "${workspaceFolder}\\target\\debug\\jwtui.exe",
"args": [],
"sourceLanguages": [ "rust" ],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'jwt-ui'",
"name": "Debug executable 'jwtui'",
"cargo": {
"args": [
"build",
"--bin=jwt-ui",
"--package=jwt-ui"
"--bin=jwtui",
"--package=jwtui"
],
"filter": {
"name": "jwt-ui",
"name": "jwtui",
"kind": "bin"
}
},
Expand All @@ -34,16 +34,16 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'jwt-ui'",
"name": "Debug unit tests in executable 'jwtui'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=jwt-ui",
"--package=jwt-ui"
"--bin=jwtui",
"--package=jwtui"
],
"filter": {
"name": "jwt-ui",
"name": "jwtui",
"kind": "bin"
}
},
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Deepu K Sasidharan
Copyright (c) 2024 Deepu K Sasidharan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@

[![Follow Deepu K Sasidharan (deepu105)](https://img.shields.io/twitter/follow/deepu105?label=Follow%20Deepu%20K%20Sasidharan%20%28deepu105%29&style=social)](https://twitter.com/intent/follow?screen_name=deepu105)

```
____.__ _____________ ____ ___.___
| / \ / \__ ___/ | | \ |
| \ \/\/ / | | ______ | | / |
/\__| |\ / | | /_____/ | | /| |
\________| \__/\ / |____| |______/ |___|
\/
```

A terminal UI for decoding/encoding JSON Web Tokens inspired by [JWT.io](https://jwt.io/) and [jwt-cli](https://github.com/mike-engel/jwt-cli)

![UI](screenshots/decoder.png)
Expand Down Expand Up @@ -107,7 +116,7 @@ Options:

## Features

- Fully offline
- Fully offline
- Dark/Light themes
- Sensible keyboard shortcuts

Expand Down
20 changes: 0 additions & 20 deletions deployment/chocolatey/chocolateyinstall.ps1.template

This file was deleted.

53 changes: 0 additions & 53 deletions deployment/chocolatey/kdash.nuspec.template

This file was deleted.

27 changes: 0 additions & 27 deletions deployment/chocolatey/packager.py

This file was deleted.

4 changes: 2 additions & 2 deletions deployment/getLatest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# The install script is licensed under the CC-0 1.0 license.
# The install script is licensed under the MIT license.

# See https://github.com/jwt-rs/jwt-ui/blob/main/LICENSE for more details.
#
Expand All @@ -9,7 +9,7 @@

GITHUB_REPO="jwt-ui"
GITHUB_USER="jwt-rs"
EXE_FILENAME="jwt-ui"
EXE_FILENAME="jwtui"
EXE_DEST_DIR="/usr/local/bin"

bye() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@

# Documentation: https://docs.brew.sh/Formula-Cookbook
# https://rubydoc.brew.sh/Formula
class jwt-ui < Formula
desc "A fast and simple dashboard for Kubernetes written in Rust"
class JwtUi < Formula
desc "A Terminal UI for decoding/encoding JSON Web Tokens"
homepage "https://github.com/jwt-rs/jwt-ui"
if OS.mac?
url "https://github.com/jwt-rs/jwt-ui/releases/download/$version/jwt-ui-macos.tar.gz"
url "https://github.com/jwt-rs/jwt-ui/releases/download/$version/jwtui-macos.tar.gz"
sha256 "$hash_mac"
else
url "https://github.com/jwt-rs/jwt-ui/releases/download/$version/jwt-ui-linux.tar.gz"
url "https://github.com/jwt-rs/jwt-ui/releases/download/$version/jwtui-linux.tar.gz"
sha256 "$hash_linux"
end
version "$version"
license "MIT"

def install
bin.install "jwt-ui"
ohai "You're done! Run with \"jwt-ui\""
ohai "For runtime flags, see \"jwt-ui --help\""
bin.install "jwtui"
ohai "You're done! Run with \"jwtui\""
ohai "For runtime flags, see \"jwtui --help\""
end
end
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"homepage": "https://github.com/jwt-rs/jwt-ui",
"description": "A fast and simple dashboard for Kubernetes",
"description": "A Terminal UI for decoding/encoding JSON Web Tokens",
"version": "$version64",
"license": "MIT",
"architecture": {
"64bit": {
"url": "https://github.com/jwt-rs/jwt-ui/releases/download/v$version64/jwt-ui-windows.tar.gz",
"url": "https://github.com/jwt-rs/jwt-ui/releases/download/v$version64/jwtui-windows.tar.gz",
"hash": "$hash_64"
}
},
"bin": "jwt-ui.exe",
"bin": "jwtui.exe",
"checkver": "github",
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/jwt-rs/jwt-ui/releases/download/v$version/jwt-ui-windows.tar.gz",
"url": "https://github.com/jwt-rs/jwt-ui/releases/download/v$version/jwtui-windows.tar.gz",
"hash": {
"url": "https://github.com/jwt-rs/jwt-ui/releases/download/v$version/jwt-ui-windows.sha256",
"url": "https://github.com/jwt-rs/jwt-ui/releases/download/v$version/jwtui-windows.sha256",
"regex": "$sha256"
}
}
Expand Down

0 comments on commit 10c3e8d

Please sign in to comment.