Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to release workflow #16

Merged
merged 6 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
922 changes: 320 additions & 602 deletions Cargo.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,58 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
publish-happ:
permissions:
contents: write
runs-on: ubuntu-22.04
outputs:
releaseId: $\{{ steps.create-release.outputs.id }}
appVersion: $\{{ steps.version.outputs.APP_VERSION }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Checks out a copy of your repository on the ubuntu-latest machine
- uses: actions/checkout@v3

- name: Install nix
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable

- uses: cachix/cachix-action@v12
with:
name: holochain-ci

- uses: cachix/cachix-action@v12
with:
name: holochain-open-dev

- uses: cachix/cachix-action@v12
with:
name: darksoil-studio

- name: Install and test
run: |
nix-store --gc
nix develop --command bash -c "{{lower_case package_manager}} install && {{lower_case package_manager}} run build:happ"

- name: Retrieve version
run: |
echo "APP_VERSION=$(cat src-tauri/tauri.conf.json | grep -oP '(?<="version": ")[^"]*')" >> $GITHUB_OUTPUT
id: version

- id: create-release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "workdir/{{kebab_case app_name}}.happ"
body: "See assets below to download and install this version."
name: {{title_case app_name}} v$\{{ steps.version.outputs.APP_VERSION }}
tag: v$\{{ steps.version.outputs.APP_VERSION }}
prerelease: true
draft: true

release-tauri-app:
needs: publish-happ
strategy:
fail-fast: false
matrix:
Expand All @@ -27,11 +78,29 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 20
{{#if (eq lower_case package_manager "yarn")}}
cache: 'yarn'
{{/if}}

{{#if (eq lower_case package_manager "pnpm")}}
- name: Setup pnpm
uses: pnpm/action-setup@v3 # docs https://pnpm.io/continuous-integration#github-actions
with:
version: 9 # Optional: specify a pnpm version

{{else }}
{{#if (eq lower_case package_manager "yarn")}}
- name: Setup yarn
run: npm install -g yarn

{{/if}}
{{/if}}
- name: install Rust stable
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable

- name: install Go stable
uses: actions/setup-go@v4
with:
Expand All @@ -58,13 +127,21 @@ jobs:
run: |
{{lower_case package_manager}} install

- name: Download release of the .happ
uses: robinraju/release-downloader@v1.10
env:
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
with:
token: $\{{ secrets.GITHUB_TOKEN }}
releaseId: $\{{ needs.publish-happ.outputs.releaseId }}
fileName: '{{kebab_case app_name}}.happ'
out-file-path: 'workdir/'

- name: build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "{{title_case app_name}} v__VERSION__"
releaseBody: "See assets below to download and install this version."
releaseId: $\{{ needs.publish-happ.outputs.releaseId }}
releaseDraft: true
prerelease: true
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1",
"identifier": "{{identifier}}",
"build": {
"beforeBuildCommand": "npm run build -w ui && npm run build:happ",
"beforeBuildCommand": "npm run build -w ui",
"devUrl": "http://localhost:1420",
"frontendDist": "../ui/dist"
},
Expand Down
180 changes: 166 additions & 14 deletions crates/tauri-plugin-holochain/permissions/autogenerated/reference.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,166 @@
| Permission | Description |
|------|-----|
|`allow-get-locales`|Enables the get_locales command without any pre-configured scope.|
|`deny-get-locales`|Denies the get_locales command without any pre-configured scope.|
|`allow-get-runtime-info`|Enables the get_runtime_info command without any pre-configured scope.|
|`deny-get-runtime-info`|Denies the get_runtime_info command without any pre-configured scope.|
|`allow-is-holochain-ready`|Enables the is_holochain_ready command without any pre-configured scope.|
|`deny-is-holochain-ready`|Denies the is_holochain_ready command without any pre-configured scope.|
|`allow-list-apps`|Enables the list_apps command without any pre-configured scope.|
|`deny-list-apps`|Denies the list_apps command without any pre-configured scope.|
|`allow-open-app`|Enables the open_app command without any pre-configured scope.|
|`deny-open-app`|Denies the open_app command without any pre-configured scope.|
|`allow-sign-zome-call`|Enables the sign_zome_call command without any pre-configured scope.|
|`deny-sign-zome-call`|Denies the sign_zome_call command without any pre-configured scope.|

### Permission Table

<table>
<tr>
<th>Identifier</th>
<th>Description</th>
</tr>


<tr>
<td>

`holochain:allow-get-locales`

</td>
<td>

Enables the get_locales command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:deny-get-locales`

</td>
<td>

Denies the get_locales command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:allow-get-runtime-info`

</td>
<td>

Enables the get_runtime_info command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:deny-get-runtime-info`

</td>
<td>

Denies the get_runtime_info command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:allow-is-holochain-ready`

</td>
<td>

Enables the is_holochain_ready command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:deny-is-holochain-ready`

</td>
<td>

Denies the is_holochain_ready command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:allow-list-apps`

</td>
<td>

Enables the list_apps command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:deny-list-apps`

</td>
<td>

Denies the list_apps command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:allow-open-app`

</td>
<td>

Enables the open_app command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:deny-open-app`

</td>
<td>

Denies the open_app command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:allow-sign-zome-call`

</td>
<td>

Enables the sign_zome_call command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`holochain:deny-sign-zome-call`

</td>
<td>

Denies the sign_zome_call command without any pre-configured scope.

</td>
</tr>
</table>
8 changes: 4 additions & 4 deletions crates/tauri-plugin-holochain/permissions/schemas/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"minimum": 1.0
},
"description": {
"description": "Human-readable description of what the permission does.",
"description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [
"string",
"null"
Expand Down Expand Up @@ -111,7 +111,7 @@
"type": "string"
},
"description": {
"description": "Human-readable description of what the permission does.",
"description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [
"string",
"null"
Expand Down Expand Up @@ -172,7 +172,7 @@
}
},
"Scopes": {
"description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
"type": "object",
"properties": {
"allow": {
Expand All @@ -186,7 +186,7 @@
}
},
"deny": {
"description": "Data that defines what is denied by the scope.",
"description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
"type": [
"array",
"null"
Expand Down
Loading
Loading