Skip to content

Commit

Permalink
Set app names and versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rosseyre committed May 4, 2024
1 parent 0b4253f commit a2954a9
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 77 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/release-codesigned.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: install Go stable
uses: actions/setup-go@v4
with:
go-version: 'stable'
go-version: "stable"
- name: install app dependencies and info
run: npm install && npm run tauri info

Expand All @@ -48,7 +48,6 @@ jobs:
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.2.7-rc.1-x86_64-pc-windows-msvc.exe
- name: setup binaries (macos only)
if: matrix.platform == 'macos-11'
run: |
Expand All @@ -62,7 +61,6 @@ jobs:
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.7-rc.1-x86_64-apple-darwin
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
Expand All @@ -82,7 +80,6 @@ jobs:
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.7-rc.1-x86_64-unknown-linux-gnu
- name: generate dist folder
run: npm run dist

Expand All @@ -103,13 +100,12 @@ jobs:

with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "replace-me v__VERSION__"
releaseName: "SAN-0.0.1 v__VERSION__"
releaseBody: "See assets below to download and install this version."
releaseDraft: true
prerelease: true
args: --verbose


### Everything below this line is code signing for Windows via azure key vault, following these instructions:
### https://melatonin.dev/blog/how-to-code-sign-windows-installers-with-an-ev-cert-on-github-actions/
### HELP Remove everything below if Windows code signing is NOT wanted.
Expand All @@ -122,7 +118,7 @@ jobs:
dotnet tool install --global AzureSignTool
# replace-me -- HELP
# SAN-0.0.1 -- HELP
# 1. replace all occurrences of [[GITHUB_REPO_NAME]] with the name you of your GitHub repository
# 2. replace all occurrences of [[productName]] with the productName field in tauri.conf.json
# 3. replace all occurrences of [[version]] with the version field in tauri.conf.json
Expand Down Expand Up @@ -161,16 +157,15 @@ jobs:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}


- name: upload signed .msi, .msi.zip, .msi.zip.sig, .exe, .nsis.zip, .nsis.zip.sig files to github release (Windows only)
uses: matthme/tauri-action-ev-signing@upload-only
if: matrix.platform == 'windows-2019'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "replace-me v__VERSION__"
releaseName: "SAN-0.0.1 v__VERSION__"
releaseBody: "See assets below to download and install this version."
releaseDraft: true
prerelease: true
args: --verbose
args: --verbose
9 changes: 3 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: install Go stable
uses: actions/setup-go@v4
with:
go-version: 'stable'
go-version: "stable"
- name: install app dependencies and info
run: npm install && npm run tauri info

Expand All @@ -47,7 +47,6 @@ jobs:
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.2.7-rc.1-x86_64-pc-windows-msvc.exe
- name: setup binaries (macos only)
if: matrix.platform == 'macos-11'
run: |
Expand All @@ -67,7 +66,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libcanberra-gtk-module libcanberra-gtk3-module build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools libgtksourceview-3.0-dev libappindicator3-dev patchelf librsvg2-dev ayatana-indicator-application
- name: setup binaries (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
Expand All @@ -82,7 +80,6 @@ jobs:
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.2.7-rc.1-x86_64-unknown-linux-gnu
- name: generate dist folder
run: npm run dist

Expand All @@ -94,8 +91,8 @@ jobs:
with:
projectPath: src-tauri # specifying to prevent action from looking for artifacts in crates/hc_launch/src-tauri
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "replace-me v__VERSION__"
releaseName: "SAN001 v__VERSION__"
releaseBody: "See assets below to download and install this version."
releaseDraft: true
prerelease: true
args: --verbose
args: --verbose
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repository let's you easily convert your Holochain app into a standalone ta
1. Install [Rust](https://www.rust-lang.org/tools/install) and [Go](https://go.dev/doc/install) (Go is required for Holochain version 0.2.X). Then follow the [Tauri Prerequisites](https://tauri.app/v1/guides/getting-started/prerequisites) instructions for your platform.

2. Either use this repository as a template (by clicking on the green "Use this template" button) or fork it.<br>
Using it as a template allows you to start with a clean git history and the contributors of this repository won't show up as contributors to your new repository. **Forking has the advantage of being able to relatively easily pull in updates from this parent repository at a later stage.**
Using it as a template allows you to start with a clean git history and the contributors of this repository won't show up as contributors to your new repository. **Forking has the advantage of being able to relatively easily pull in updates from this parent repository at a later stage.**

3. After cloning the newly created repository, run `npm install` to install the relevant tauri dependencies.

Expand Down Expand Up @@ -45,7 +45,6 @@ For further releases:

3. Push to github to trigger the release workflow.


## Code-signed cross-platform Binaries

The `.github/workflows/release-codesigned.yaml` contains a template workflow for binaries with macOS as well as Windows EV Certificate code signing. The workflow gets triggered when publishing on branch `release-codesigned`.
Expand All @@ -58,22 +57,20 @@ For the Windows part or if you want to only do macOS code signing, follow the in

If you want to sign your Windows binaries with an OV certificate instead of an EV certificate, follow [tauri's instructions](https://tauri.app/v1/guides/distribution/sign-windows).


## Auto-Updating of your App

To add automatic updates to your app, you may follow the instructions [here](https://tauri.app/v1/guides/distribution/updater).
An empty `updater.json` template file is part of this repository.

Some important notes:

* The Holochain Kangaroo stores data on the filesystem according to [semantic versioning](https://semver.org/). See [Note on versioning](#note-on-versioning)
- The Holochain Kangaroo stores data on the filesystem according to [semantic versioning](https://semver.org/). See [Note on versioning](#note-on-versioning)

* If you bump your Holochain and/or lair keystore version, you need to consider whether it remains compatible with the existing Holochain conductor / lair keystore.
- If you bump your Holochain and/or lair keystore version, you need to consider whether it remains compatible with the existing Holochain conductor / lair keystore.

As a consequence, **be careful not to trigger automatic updates on your end-users if your app
is a breaking change due to one of the above mentioned scenarios**.


## Note on Versioning

The Holochain Kangaroo stores data on the filesystem according to [semantic versioning](https://semver.org/), for which it considers the app version specified in `src-tauri/tauri.conf.json`. This has implications on your choice of the version number.
Expand All @@ -90,11 +87,9 @@ Pre-releases are always stored in independent subfolders (0.1.0-alpha.1 is consi

## Troubleshooting

* If you get the error `Error failed to bundle project: Failed to build data folders and files` when running `npm run tauri build`, a likely reason is that your `productName` in `src-tauri/tauri.conf.json` contains invalid characters, such as dots (`.`)

* If building the app fails with errors like `Error: No artifacts were found.` or `Error failed to bundle project: error running light.exe` the reason may again be that the `productName` in `src-tauri/tauri.conf.json` contains invalid characters such as parentheses (`(` or `)`) or possibly other unsupported special characters.

- If you get the error `Error failed to bundle project: Failed to build data folders and files` when running `npm run tauri build`, a likely reason is that your `productName` in `src-tauri/tauri.conf.json` contains invalid characters, such as dots (`.`)

- If building the app fails with errors like `Error: No artifacts were found.` or `Error failed to bundle project: error running light.exe` the reason may again be that the `productName` in `src-tauri/tauri.conf.json` contains invalid characters such as parentheses (`(` or `)`) or possibly other unsupported special characters.

## Recommended IDE Setup

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "replace-me",
"name": "SAN001",
"private": true,
"version": "0.0.0",
"version": "0.0.11",
"type": "module",
"scripts": {
"kangaroo": "npm run dist && npm run tauri build",
Expand Down
Binary file added pouch/data-commons-mvp.happ
Binary file not shown.
Binary file added pouch/ui.zip
Binary file not shown.
62 changes: 31 additions & 31 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "holochain-kangaroo" # replace-me
version = "0.0.0" # replace-me -- Choose wisely, see "Note on Versioning" in README
name = "SAN001" # replace-me
version = "0.0.11" # replace-me -- Choose wisely, see "Note on Versioning" in README
description = "A Tauri App"
authors = ["you"]
authors = ["Arkology Studio"]
license = ""
repository = ""
edition = "2021"
Expand Down
12 changes: 6 additions & 6 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ use commands::{
};
use utils::{create_and_apply_lair_symlink, sign_zome_call, ZOOM_ON_SCROLL};

const APP_NAME: &str = "replace-me"; // name of the app. Can be changed without breaking your app.
const APP_ID: &str = "replace-me"; // App id used to install your app in the Holochain conductor - can be the same as APP_NAME. Changing this means a breaking change to your app.
pub const WINDOW_TITLE: &str = "replace-me"; // Title of the window
const APP_NAME: &str = "SAN001"; // name of the app. Can be changed without breaking your app.
const APP_ID: &str = "data-commons-mvp"; // App id used to install your app in the Holochain conductor - can be the same as APP_NAME. Changing this means a breaking change to your app.
pub const WINDOW_TITLE: &str = "SAN"; // Title of the window
pub const WINDOW_WIDTH: f64 = 1400.0; // Default window width when the app is opened
pub const WINDOW_HEIGHT: f64 = 880.0; // Default window height when the app is opened
const PASSWORD: &str = "pass"; // Password to the lair keystore
pub const DEFAULT_NETWORK_SEED: Option<&str> = None; // replace-me (optional): Depending on your application, you may want to put a network seed here or
pub const DEFAULT_NETWORK_SEED: Option<&str> = None; // SAN-0.0.1 (optional): Depending on your application, you may want to put a network seed here or
// read it secretly from an environment variable. If so, replace `None` with `Some("your network seed here")`
const SIGNALING_SERVER: &str = "wss://signal.holo.host"; // replace-me (optional): Change the signaling server if you want
const SIGNALING_SERVER: &str = "wss://signal.holo.host"; // SAN-0.0.1 (optional): Change the signaling server if you want

mod commands;
mod conductor;
Expand Down Expand Up @@ -358,7 +358,7 @@ pub async fn install_app_if_necessary(
.map_err(|e| AppError::ConductorApiError(e))?;

// replace-me --- replace the path with the correct path to your .happ file here
let app_bundle = AppBundle::decode(include_bytes!("../../pouch/hc-stress-test.happ"))
let app_bundle = AppBundle::decode(include_bytes!("../../pouch/data-commons-mvp.happ"))
.map_err(|e| AppError::AppBundleError(e))?;

admin_ws
Expand Down
6 changes: 3 additions & 3 deletions src-tauri/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub fn create_and_apply_lair_symlink(keystore_data_dir: PathBuf, ) -> AppResult<
// overwrite connectionUrl in lair-keystore-config.yaml to symlink directory
// 1. read to string
let mut lair_config_string = std::fs::read_to_string(keystore_dir.join("lair-keystore-config.yaml"))
.map_err(|e| LairKeystoreError::ErrorCreatingSymLink((format!("Failed to read lair-keystore-config.yaml: {}", e))))?;
.map_err(|e| LairKeystoreError::ErrorCreatingSymLink(format!("Failed to read lair-keystore-config.yaml: {}", e)))?;

// 2. filter out the line with the connectionUrl
let connection_url_line = lair_config_string.lines().filter(|line| line.contains("connectionUrl:")).collect::<String>();
Expand All @@ -194,7 +194,7 @@ pub fn create_and_apply_lair_symlink(keystore_data_dir: PathBuf, ) -> AppResult<
)) {
Ok(url) => url,
Err(e) => return Err(AppError::LairKeystoreError(
LairKeystoreError::ErrorCreatingSymLink((format!("Failed to parse URL for symlink lair path: {}", e))))
LairKeystoreError::ErrorCreatingSymLink(format!("Failed to parse URL for symlink lair path: {}", e)))
),
};

Expand All @@ -212,7 +212,7 @@ pub fn create_and_apply_lair_symlink(keystore_data_dir: PathBuf, ) -> AppResult<
// 5. Overwrite the lair-keystore-config.yaml with the modified content
std::fs::write(keystore_dir.join("lair-keystore-config.yaml"), lair_config_string)
.map_err(|e| AppError::LairKeystoreError(
LairKeystoreError::ErrorCreatingSymLink((format!("Failed to write lair-keystore-config.yaml after modification: {}", e)))
LairKeystoreError::ErrorCreatingSymLink(format!("Failed to write lair-keystore-config.yaml after modification: {}", e))
))
}

Expand Down
8 changes: 4 additions & 4 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"withGlobalTauri": true
},
"package": {
"productName": "replace-me",
"version": "0.0.0"
"productName": "san001",
"version": "0.0.11"
},
"tauri": {
"allowlist": {
Expand All @@ -21,7 +21,7 @@
}
},
"cli": {
"description": "Running replace-me from the command line",
"description": "Running SAN from the command line",
"args": [
{
"name": "profile",
Expand All @@ -36,7 +36,7 @@
"bundle": {
"active": true,
"targets": "all",
"identifier": "replace-me.with-unique-identifier.in-reverse-domain-notation",
"identifier": "SAN-0.0.1.with-unique-identifier.in-reverse-domain-notation",
"icon": [
"icons/32x32.png",
"icons/128x128.png",
Expand Down

0 comments on commit a2954a9

Please sign in to comment.