-
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.
Merge pull request #77 from CrystallizeAPI/feature-full-bun
feat: new crystallize cli
- Loading branch information
Showing
8 changed files
with
108 additions
and
50 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,40 @@ | ||
name: Deploy to Pages | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: 'pages' | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: false | ||
|
||
- name: 📦 Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: 🦾 Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'docs/' | ||
|
||
- name: 🚢 Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
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
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
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,13 @@ | ||
<html> | ||
<head> | ||
<title>Crystallize CLI</title> | ||
</head> | ||
<body> | ||
<pre> | ||
<h1>Crystallize CLI</h1> | ||
<p>Crystallize CLI is a command line tool that helps you to manage your Crystallize projects.</p> | ||
<h2>Installation</h2> | ||
<p>curl -LSs https://crystallizeapi.github.io/cli/install.bash | bash</p> | ||
</pre> | ||
</body> | ||
</html> |
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,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
CRYSTALLIZE_HOME="$HOME/.crystallize" | ||
mkdir -p $CRYSTALLIZE_HOME | ||
cd $CRYSTALLIZE_HOME | ||
|
||
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
ARCH=$(uname -m) | ||
|
||
if [ "$ARCH" = "x86_64" ]; then | ||
ARCH="x64" | ||
elif [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then | ||
ARCH="arm64" | ||
else | ||
echo "❌ Unsupported architecture: $ARCH" | ||
exit 1 | ||
fi | ||
|
||
FILE="bun-${OS}-${ARCH}" | ||
|
||
LATEST_RELEASE=$(curl -s "https://api.github.com/repos/crystallizeapi/cli/releases/latest" | grep tag_name | cut -d'"' -f 4) | ||
URL="https://github.com/CrystallizeAPI/cli/releases/download/${LATEST_RELEASE}/crystallize-${FILE}" | ||
|
||
echo "🌍 Detected platform: ${OS}-${ARCH}" | ||
echo "📥 Downloading file: ${URL}" | ||
|
||
if curl -fLO "${URL}"; then | ||
echo "✅ Successfully downloaded ${FILE}" | ||
else | ||
echo "❌ Failed to download ${FILE}. Please check the URL or platform." | ||
exit 1 | ||
fi | ||
|
||
ln -sf $CRYSTALLIZE_HOME/crystallize-${FILE} $HOME/crystallize | ||
chmod +x $HOME/crystallize | ||
|
||
echo "You can now use Crystallize CLI by running: ~/crystallize" | ||
echo "" | ||
echo "- You may want to put ~/crystallize in you PATH" | ||
echo "- You may want to creat an alias (in your .zshrc or .bashrc) alias crystallize='~/crystallize'" | ||
|
||
~/crystallize |
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
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