Skip to content

Commit

Permalink
Prepared v0.11 release
Browse files Browse the repository at this point in the history
  • Loading branch information
hkdb committed Jun 18, 2024
1 parent 1f55b02 commit 4b39fe9
Show file tree
Hide file tree
Showing 16 changed files with 263 additions and 35 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Release
on:
push:
tags: '*'

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -59,3 +60,31 @@ jobs:
run: |
TAG_NAME=${{ github.ref_name }}
gh release upload $TAG_NAME app-*/*
deploy:
needs:
- publish
runs-on: ubuntu-latest
env:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
76 changes: 50 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,49 @@ See [USAGE EXAMPLES](docs/EXAMPLES.md) to see a more complete dive into how to u
[![asciicast](https://asciinema.org/a/YmpvOaXS2dviXXOIPM7EppyKf.svg)](https://asciinema.org/a/YmpvOaXS2dviXXOIPM7EppyKf)


### INSTALL

Run the below command in the terminal:

```
bash <(curl -sL https://hkdb.github.io/app/getapp.sh)
```

You can also install app by compiling yourself:

1. Make sure all the package managers you want app to manage and are installed and configured properly
2. Install `git` manually if it's not already installed
3. cd into a directory of choice where you want to keep the app repo. If you are an end user and can't decide, I suggest `~/.config` (`mkdir ~/.config` if it doesn't already exist)
4. git clone https://github.com/hkdb/app.git`
5. `cd app`
6. Optionally `git checkout <version>`
7. `./install.sh` # Note, for FreeBSD, bash must first be installed.


### UPDATE/UPGRADE

Run the below command in the terminal:

```
app -m app update
```

You can also update app by compiling it yourself:

Tracking versioned release:

1. cd back into the repo whereever you put it. `~/.config/app` if you took my recommendation
2. `git pull`
3. `git checkout <version tag>`
3. `./update.sh` # FreeBSD requires bash to be installed

Tracking main branch:

1. cd back into the repo whreever you put it. `~/.config/app` if you took my recommendation
2. `git pull`
3. `./update.sh` # FreeBSD requires bash to be installed


### SUPPORT & ROADMAP

- GNU/Linux (apt, dnf, pacman, flatpak, snap, brew, appimage)
Expand All @@ -84,7 +127,9 @@ Currently in the roadmap:

`Pre-requisites`:

There's an install script that comes with this repo which is the preferred way to install app. It takes care of most of the immediate dependencies but I leave having each of your package managers proper setup/configuration to the end user before running app. For example, if you don't have the right packages installed to have add-apt-repository work properly on Debian or flatpak can't be used without sudo, then app will inevitably fail. I am however open to installing or auto-configuring more dependencies in the future if this ends up being used by others and that's something that everyone wants.
Curl and Unzip must be installed

There's an install script that comes with this repo which is the preferred way to install app. However, I leave having each of your package managers proper setup/configuration to the end user before running app. For example, if you don't have the right packages installed to have add-apt-repository work properly on Debian or flatpak can't be used without sudo, then app will inevitably fail.

See the below notes on package manager setup:
- [flatpak](docs/FLATPAK.md)
Expand Down Expand Up @@ -116,35 +161,14 @@ app does not handle local packages for Arch based distros as most of the time, u

As far as I know, there's no way to easily add third party repos especially since the whole backend is closed source.

`go/pip/cargo`:

The go, pip, and cargo support is not meant to be a replacement for development purposes but rather for users that use software that are distributed via go, pip, and cargo.


### INSTALL

1. Make sure all the package managers you want app to manage and are installed and configured properly
2. Install `git` manually if it's not already installed
3. cd into a directory of choice where you want to keep the app repo. If you are an end user and can't decide, I suggest `~/.config` (`mkdir ~/.config` if it doesn't already exist)
4. `git clone https://github.com/hkdb/app.git`
5. `cd app`
6. `./install.sh` or if you are installing from BSD, run `bash install.sh`


### UPDATE/UPGRADE
`Caveat`: AppImage

Tracking versioned release:
If your AppImage app updates itself, you may need to manually edit your .desktop file in `$HOME/.local/share/applications/` to point to the correct AppImage file in `$HOME/.config/app/packages/local/appimage/` since the new file has a new version on the file name.

1. cd back into the repo whereever you put it. `~/.config/app` if you took my recommendation
2. `git pull`
3. `git checkout <version tag>`
3. `./update.sh` # FreeBSD requires bash to be installed
`go/pip/cargo`:

Tracking main branch:
The go, pip, and cargo support is not meant to be a replacement for development purposes but rather for users that use software that are distributed via go, pip, and cargo.

1. cd back into the repo whreever you put it. `~/.config/app` if you took my recommendation
2. `git pull`
3. `./update.sh` # FreeBSD requires bash to be installed

### SUPPORT US!

Expand Down
9 changes: 7 additions & 2 deletions cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

var m = flag.String("m", "",
"Package Manager\n usage: app -m <package manager> install neovim\n default: auto-detect of native pkg manager <apt/dnf/pacman/pkg>\n example: app install neovim\n options:\n\t- apt\n\t- dnf\n\t- pacman\n\t- yay\n\t- pkg\n\t- zypper\n\t- flatpak\n\t- snap\n\t- brew\n\t- go\n\t- pip\n\t- cargo\n\t- appimage\n")
"Package Manager\n usage: app -m <package manager> install neovim\n default: auto-detect of native pkg manager <apt/dnf/pacman/pkg>\n example: app install neovim\n options:\n\t- apt\n\t- dnf\n\t- pacman\n\t- yay\n\t- pkg\n\t- zypper\n\t- flatpak\n\t- snap\n\t- brew\n\t- go\n\t- pip\n\t- cargo\n\t- appimage\n\t- app (ONLY FOR UPDATING app ITSELF)\n")
var r = flag.String("r", "",
"Restore / Install all on new system\n usage: app -r <type>\n option:\n\t- apt\n\t- dnf\n\t- pacman\n\t- yay\n\t- pkg\n\t- zypper\n\t- flatpak\n\t- snap\n\t- brew\n\t- go\n\t- pip\n\t- cargo\n\t- appimage\n\t- all\n")
var y = flag.Bool("y", false,
Expand Down Expand Up @@ -39,6 +39,11 @@ func ParseFlags() env.Flags {
utils.PrintErrorMsgExit("Input Error:", "If you are trying to specify multiple packages, wrap the pacakges with single quotes....")
}

// For app update
if *m == "app" && a != "update" {
utils.PrintErrorMsgExit("Input Error:", "app can only be specified to update itself...")
}

// If -r flag is empty, then it's not a restore and therefore, we are either
// installing, upgrading, dist-upgrading, uninstalling, purging, searching, or autoremoving
if *r == "" {
Expand Down Expand Up @@ -96,7 +101,7 @@ func ParseFlags() env.Flags {
}
if p != "" {
fmt.Println(utils.ColorRed,
"-p (package(s)) must not be specified when you are restoring the system with -r... Try",
"package(s) must not be specified when you are restoring the system with -r... Try",
utils.ColorYellow, "./app -h", utils.ColorRed, "to learn more...\n", utils.ColorReset)
os.Exit(1)
}
Expand Down
Binary file added dist/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/getapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# app installer #
#################

VER="v0.10"
VER="v0.11"
CYAN='\033[0;36m'
GREEN='\033[1;32m'
NC='\033[0m'
Expand Down
Binary file added dist/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<html>
<head>
<title>app - The Cross-Platform Package Management Assistant with Super Powers!</title>
<link rel="icon" type="image/icon" href="./icon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@200&display=swap" rel="stylesheet">
<script>
// Get the <pre> element
const preTag = document.getElementById("icmd");

// Create a copy button element
const copyButton = document.createElement("span");
copyButton.innerText = "Copy";
copyButton.classList.add("copy-button");

// Append the copy button to the <pre> tag
preTag.appendChild(copyButton);

// Add click event listener to the copy button
copyButton.addEventListener("click", () => {
// Hide the copy button temporarily
copyButton.style.display = "none";

// Create a range and select the text inside the <pre> tag
const range = document.createRange();
range.selectNode(preTag);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);

try {
// Copy the selected text to the clipboard
document.execCommand("copy");

// Alert the user that the text has been copied
copyButton.innerText = "Copied!";
setTimeout(function(){
copyButton.innerText = "Copy";
}, 2000);
} catch (err) {
console.error("Unable to copy text:", err);
} finally {
// Show the copy button again
copyButton.style.display = "inline";

// Deselect the text
window.getSelection().removeAllRanges();
}
});
</script>
</head>
<style>
html, body {
margin: 0px;
padding: 0px;
background-color: #262833;
color: #f5f5f5;
height: 100%;
width: 100vw;
}
div {
margin: 0;
text-align: center;
}
p {
font-family: 'Nunito', sans-serif;
font-size: 14pt;
}
.banner {
margin: 0;
margin-top: 15%;
max-width: 90vw;
}
.codeblock{
position: relative;
text-align: center;
align-content: center;
}
.logo {
margin: 0;
width: 50px;
}
pre {
display: inline-block;
background: #4d4d4d;
color: #f5f5f5;
padding: 20px;
font-size: 15px;
word-wrap: break-word;
white-space: pre-wrap;
border: 1px solid #e6e7e9;
border-radius: 15px;
max-width: 800px;
text-align: center;
}
.copy-button {
position: absolute;
top: 2px;
right: 10px;
cursor: pointer;
color: #fff;
background: gray;
border-radius: 0.5em;
padding: 2px 7px;
}

.copy-button:hover {
color: #000;
}
</style>
<body>
<div>
<img class="banner" src="banner.jpg">
</div>
<div class="codeblock">
<p>copy and paste the below command into your terminal to install:</p>
<pre id="icmd">bash <(curl -sL https://hkdb.github.io/app/getapp.sh)</pre>
</div>
<div>
<p>learn more about app at:</p>
<a target="_blank" href="https://github.com/hkdb/app"><img class="logo" src="github.png"></a>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion dist/updateapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# app updater #
###############

VER="v0.10"
VER="v0.11"
CYAN='\033[0;36m'
GREEN='\033[1;32m'
NC='\033[0m'
Expand Down
16 changes: 13 additions & 3 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
## INSTALL

1. Make sure all the package managers you want app to manage are installed and configured properly
Run the below command in the terminal:

```
bash <(curl -sL https://hkdb.github.io/app/getapp.sh)
```

You can also install app by compiling yourself:

1. Make sure all the package managers you want app to manage and are installed and configured properly
2. Install `git` manually if it's not already installed
3. cd into a directory of choice where you want to keep the app repo. If you are an end user and can't decide, I suggest `~/.config` (`mkdir ~/.config` if it doesn't already exist)
4. `git clone https://github.com/hkdb/app.git`
4. git clone https://github.com/hkdb/app.git`
5. `cd app`
6. `./install.sh` # FreeBSD requires bash to be installed
6. Optionally `git checkout <version>`
7. `./install.sh` # Note, for FreeBSD, bash must first be installed.

9 changes: 9 additions & 0 deletions docs/UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## UPDATE/UPGRADE

Run the below command in the terminal:

```
app -m app update
```

You can also update app by compiling it yourself:

Tracking versioned release:

1. cd back into the repo whereever you put it. `~/.config/app` if you took my recommendation
Expand All @@ -12,3 +20,4 @@ Tracking main branch:
1. cd back into the repo whreever you put it. `~/.config/app` if you took my recommendation
2. `git pull`
3. `./update.sh` # FreeBSD requires bash to be installed

1 change: 1 addition & 0 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ OPTIONS:
- pip
- cargo
- appimage
- app (ONLY FOR UPDATING app ITSELF)
-r string
Restore / Install all on new system
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

func main() {

utils.LogLaunchBanner("v0.10")
utils.LogLaunchBanner("v0.11")

// Detect environment
cli.GetEnv()
Expand Down
2 changes: 2 additions & 0 deletions mgr/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ func execute(m, a, p, g, c string, classic bool, tag string, sort bool) {
pip.Update()
case "cargo":
cargo.Update()
case "app":
utils.UpdateApp()
default:
fmt.Println("Unsupported package manager... Exiting...\n")
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion mgr/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
func isEnabled(pm string) bool {

switch pm {
case "apt", "dnf", "pacman", "pkg", "zypper":
case "apt", "dnf", "pacman", "pkg", "zypper", "app":
return true
case "yay":
if env.Yay == false {
Expand Down
Loading

0 comments on commit 4b39fe9

Please # to comment.