-
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.
- Loading branch information
Showing
12 changed files
with
1,309 additions
and
78 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,148 @@ | ||
name: Build CLI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-ubuntu-x64: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21.x' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn run build | ||
- run: yarn run package | ||
- run: cp $(command -v node) ndjson-downloader | ||
- run: npx postject ndjson-downloader NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 | ||
- name: Move Scripts | ||
run: cp scripts/* . | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ndjson-downloader_linux_x64 | ||
path: | | ||
install.sh | ||
install.zsh | ||
install.fish | ||
ndjson-downloader | ||
README.md | ||
LICENSE | ||
- name: Compress Archive | ||
run: zip ndjson-downloader_linux_x64.zip ndjson-downloader README.md LICENSE install.sh install.zsh install.fish | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Upload Release Artifact | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ndjson-downloader_linux_x64.zip | ||
|
||
build-macos-x64: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21.x' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn run build | ||
- run: yarn run package | ||
- run: cp $(command -v node) ndjson-downloader | ||
- run: codesign --remove-signature ndjson-downloader | ||
- run: npx postject ndjson-downloader NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA | ||
- run: codesign --sign - ndjson-downloader | ||
- name: Move Scripts | ||
run: cp scripts/* . | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ndjson-downloader_macos_x64 | ||
path: | | ||
install.sh | ||
install.zsh | ||
install.fish | ||
ndjson-downloader | ||
README.md | ||
LICENSE | ||
- name: Compress Archive | ||
run: zip ndjson-downloader_macos_x64.zip ndjson-downloader README.md LICENSE install.sh install.zsh install.fish | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Upload Release Artifact | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ndjson-downloader_macos_x64.zip | ||
|
||
build-macos-arm64: | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21.x' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn run build | ||
- run: yarn run package | ||
- run: cp $(command -v node) ndjson-downloader | ||
- run: codesign --remove-signature ndjson-downloader | ||
- run: npx postject ndjson-downloader NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 --macho-segment-name NODE_SEA | ||
- run: codesign --sign - ndjson-downloader | ||
- name: Move Scripts | ||
run: cp scripts/* . | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ndjson-downloader_macos_arm64 | ||
path: | | ||
install.sh | ||
install.zsh | ||
install.fish | ||
ndjson-downloader | ||
README.md | ||
LICENSE | ||
- name: Compress Archive | ||
run: zip ndjson-downloader_macos_arm64.zip ndjson-downloader README.md LICENSE install.sh install.zsh install.fish | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Upload Release Artifact | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ndjson-downloader_macos_arm64.zip | ||
|
||
build-windows-x64: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21.x' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn run build | ||
- run: yarn run package | ||
- run: node -e "require('fs').copyFileSync(process.execPath, 'ndjson-downloader.exe')" | ||
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v2 | ||
with: | ||
sdk-version: 22621 | ||
- run: '& "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\signtool.exe" remove /s .\ndjson-downloader.exe' | ||
- run: npx postject ndjson-downloader.exe NODE_SEA_BLOB sea-prep.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 | ||
- name: Move Scripts | ||
run: cp scripts/* . | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ndjson-downloader_windows_x64 | ||
path: | | ||
install.bat | ||
install.ps1 | ||
ndjson-downloader.exe | ||
README.md | ||
LICENSE | ||
- name: Compress Archive | ||
run: Compress-Archive -Path ".\ndjson-downloader.exe", ".\README.md", ".\LICENSE", ".\install.bat", ".\install.ps1" ndjson-downloader_windows_x64.zip | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Upload Release Artifact | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: ndjson-downloader_windows_x64.zip | ||
|
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 was deleted.
Oops, something went wrong.
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,21 @@ | ||
@echo off | ||
setlocal | ||
|
||
:: Define the application executable name and its current location | ||
set "appName=filebase.exe" | ||
set "currentAppPath=%appName%" | ||
|
||
:: Define the target installation directory in Program Files | ||
set "installPath=%ProgramFiles%\filebase" | ||
|
||
:: Create the target directory if it doesn't exist | ||
if not exist "%installPath%" mkdir "%installPath%" | ||
|
||
:: Copy the application executable to the target directory | ||
copy ./filebase.exe "%installPath%" | ||
|
||
:: Add the application's directory to the system PATH environment variable | ||
:: This allows the application to be run from anywhere in the terminal | ||
setx PATH "%PATH%;%installPath%" /M | ||
|
||
echo Installation and configuration complete. You can now run %appName% from the terminal. |
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,30 @@ | ||
#!/usr/bin/env fish | ||
|
||
# Define the application executable name and its current location | ||
set appName "filebase" | ||
set currentAppPath "../$appName" | ||
|
||
# Function to check if a path is in the PATH environment variable | ||
function isInPath | ||
echo ":$PATH:" | grep -Fq ":$argv[1]:" | ||
end | ||
|
||
# Determine the installation path based on what's available in PATH | ||
if isInPath "/usr/local/bin" | ||
set installPath "/usr/local/bin" | ||
else if isInPath "/usr/bin" | ||
set installPath "/usr/bin" | ||
else if isInPath "/bin" | ||
set installPath "/bin" | ||
else | ||
echo "Error: None of the preferred installation paths are in your PATH." | ||
exit 1 | ||
end | ||
|
||
# Copy the application executable to the target directory | ||
sudo cp "$currentAppPath" "$installPath/$appName" | ||
|
||
# Make sure the executable has execution permissions | ||
sudo chmod +x "$installPath/$appName" | ||
|
||
echo "Installation complete. You can now run $appName from the terminal." |
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,24 @@ | ||
# Define the application executable name and its current location | ||
$appName = "filebase.exe" | ||
$currentAppPath = "$appName" | ||
|
||
# Define the target installation directory in Program Files | ||
$installPath = Join-Path -Path $Env:ProgramFiles -ChildPath "filebase" | ||
|
||
# Create the target directory if it doesn't exist | ||
if (-not (Test-Path -Path $installPath)) { | ||
New-Item -ItemType Directory -Path $installPath | Out-Null | ||
} | ||
|
||
# Copy the application executable to the target directory | ||
Copy-Item -Path $currentAppPath -Destination $installPath | ||
|
||
# Add the application's directory to the system PATH environment variable | ||
# This allows the application to be run from anywhere in the terminal | ||
$systemPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine) | ||
if (-not ($systemPath.Split(';') -contains $installPath)) { | ||
$newPath = $systemPath + ";" + $installPath | ||
[System.Environment]::SetEnvironmentVariable("Path", $newPath, [System.EnvironmentVariableTarget]::Machine) | ||
} | ||
|
||
Write-Output "Installation and configuration complete. You can now run $appName from the terminal." |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# Define the application executable name and its current location | ||
appName="filebase" | ||
currentAppPath="$appName" | ||
|
||
# Function to check if a path is in the PATH environment variable | ||
function isInPath() { | ||
echo ":$PATH:" | grep -Fq ":$1:" | ||
} | ||
|
||
# Determine the installation path based on what's available in PATH | ||
if isInPath "/usr/local/bin"; then | ||
installPath="/usr/local/bin" | ||
elif isInPath "/usr/bin"; then | ||
installPath="/usr/bin" | ||
elif isInPath "/bin"; then | ||
installPath="/bin" | ||
else | ||
echo "Error: None of the preferred installation paths are in your PATH." | ||
exit 1 | ||
fi | ||
|
||
# Copy the application executable to the target directory | ||
sudo cp "$currentAppPath" "$installPath/$appName" | ||
|
||
# Make sure the executable has execution permissions | ||
sudo chmod +x "$installPath/$appName" | ||
|
||
echo "Installation complete. You can now run $appName from the terminal." |
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,30 @@ | ||
#!/bin/zsh | ||
|
||
# Define the application executable name and its current location | ||
appName="filebase" | ||
currentAppPath="$appName" | ||
|
||
# Function to check if a path is in the PATH environment variable | ||
function isInPath() { | ||
echo ":$PATH:" | grep -Fq ":$1:" | ||
} | ||
|
||
# Determine the installation path based on what's available in PATH | ||
if isInPath "/usr/local/bin"; then | ||
installPath="/usr/local/bin" | ||
elif isInPath "/usr/bin"; then | ||
installPath="/usr/bin" | ||
elif isInPath "/bin"; then | ||
installPath="/bin" | ||
else | ||
echo "Error: None of the preferred installation paths are in your PATH." | ||
return 1 | ||
fi | ||
|
||
# Copy the application executable to the target directory | ||
sudo cp "$currentAppPath" "$installPath/$appName" | ||
|
||
# Make sure the executable has execution permissions | ||
sudo chmod +x "$installPath/$appName" | ||
|
||
echo "Installation complete. You can now run $appName from the terminal." |
Oops, something went wrong.