Skip to content

Commit 5623f62

Browse files
authored
Merge pull request #379 from lightningrodlabs/feat/release-webhapp-ci
Add github workflow to release webhapps via CI
2 parents cb4a0df + 109ae0d commit 5623f62

23 files changed

+82
-305
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: 'release-webhapps'
2+
on:
3+
push:
4+
branches:
5+
- release-webhapps
6+
7+
jobs:
8+
publish-happ:
9+
permissions:
10+
contents: write
11+
runs-on: ubuntu-22.04
12+
outputs:
13+
releaseId: ${{ steps.create-release.outputs.id }}
14+
steps:
15+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
16+
# Checks out a copy of your repository on the ubuntu-latest machine
17+
- uses: actions/checkout@v3
18+
19+
- name: Extend space
20+
uses: ./.github/actions/extend-space
21+
22+
- name: Install nix
23+
uses: cachix/install-nix-action@v20
24+
with:
25+
install_url: https://releases.nixos.org/nix/nix-2.23.0/install
26+
27+
- uses: cachix/cachix-action@v15
28+
with:
29+
name: holochain-ci
30+
31+
- name: Install and build
32+
run: |
33+
nix-store --gc
34+
nix develop --command bash -c "holochain --version && yarn && yarn pack-happs && yarn build-webhapp"
35+
shasum -a 256 ./happs/happ/workdir/acorn.happ
36+
shasum -a 256 ./happs/happ/workdir/acorn.webhapp
37+
38+
- name: Retrieve version
39+
run: |
40+
echo "APP_VERSION=$(cat package.json | grep -oP '(?<="version": ")[^"]*')" >> $GITHUB_OUTPUT
41+
id: version
42+
43+
- id: create-release
44+
uses: ncipollo/release-action@v1
45+
with:
46+
allowUpdates: false
47+
artifacts:
48+
- 'happs/happ/workdir/acorn.webhapp'
49+
- 'happs/happ/workdir/acorn.happ'
50+
body: 'See assets below to download and install this version.'
51+
name: v${{ steps.version.outputs.APP_VERSION }}-alpha
52+
tag: v${{ steps.version.outputs.APP_VERSION }}-alpha
53+
prerelease: true
54+
draft: true

DEVELOPERS.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This will launch the ui and a electron app with the holochain conductor preconfi
2424

2525
If you want multiple instances to test multi-agent scenarios run `yarn run desktop:happ -n 2` (or any number)
2626

27-
Alternatively, instead of launching the ui separately, you can run `yarn run desktop:build-webhapp` and then `yarn run desktop:webhapp`. This will launch a fully packaged webhapp in a preconfigured electron environment.
27+
Alternatively, instead of launching the ui separately, you can run `yarn run build-webhapp` and then `yarn run desktop:webhapp`. This will launch a fully packaged webhapp in a preconfigured electron environment.
2828

2929
### Acorn Moss Tool
3030

@@ -33,27 +33,29 @@ Alternatively, instead of launching the ui separately, you can run `yarn run des
3333

3434
If you want 2 agents, open a 3rd terminal window and run `yarn run moss:happ2`
3535

36-
If you want to test the full webhapp, run `yarn run moss:build-webhapp` then run `yarn run moss:webhapp`. If you want a second agent, run `yarn run moss:webhapp2`.
36+
If you want to test the full webhapp, run `yarn run build-webhapp` then run `yarn run moss:webhapp`. If you want a second agent, run `yarn run moss:webhapp2`.
3737

3838
### Building / Packaging Desktop App
3939

40-
First, build the webhapp if you haven't done so yet:
40+
#### Step 1: Release webhapp on github
4141

42-
- `yarn run desktop:build-webhapp`
42+
First, the webapp needs to be released on github from where it can later be pulled by the CI of the `[acorn-desktop](https://github.com/lightningrodlabs/acorn-desktop)` repository.
4343

44-
This will create an `[acorn-desktop.webhapp](./happs/happ/workdir/acorn-desktop.webhapp)` file. Upload this to the [Acorn release page](https://github.com/lightningrodlabs/acorn/releases) with the appropriate version tag.
44+
To release the webhapp, update the version number of acorn in the project, including in the root level `package.json` (see [Versioning](#versioning) below), to the version that you want to release Acorn under. Then checkout the `release` branch, merge `main` into the `release` branch and push. This should trigger CI to build and release the webhapp file on github as a draft release. You can then double-check the draft release and if everything looks fine, publish it.
4545

46-
Then, clone the `[acorn-desktop](https://github.com/lightningrodlabs/acorn-desktop/tree/v11.1.2)` repo. Trigger a release by following the instructions in the README. This should trigger a github action which automatically fetches the webhapp from the previous step and builds and releases multi-platform versions of Acorn, signed and ready to download on the [release page](https://github.com/lightningrodlabs/acorn-desktop/releases).
46+
#### Step 2: Build the Desktop App
47+
48+
Then, clone the `[acorn-desktop](https://github.com/lightningrodlabs/acorn-desktop)` repo. Update the link to the webhapp in the `kangaroo.config.ts` file and trigger a release by following the instructions in the README. This should trigger a github action which automatically fetches the webhapp from the previous step and builds and releases multi-platform versions of Acorn, signed and ready to download on the [release page](https://github.com/lightningrodlabs/acorn-desktop/releases).
4749

4850
### Building / Packaging Moss Tool
4951

50-
Build the webhapp,
52+
To build the Moss tool, all you need to do is building the webhapp. You can either build it locally or through CI as described [above](#step-1-release-webhapp-on-github). TO build it locally, run:
5153

52-
- `yarn run moss:build-webhapp`
54+
- `yarn run build-webhapp`
5355

54-
This will create an `[acorn-moss.webhapp](./weave-tool/acorn-moss.webhapp)` file. Upload this to the [Acorn release page](https://github.com/lightningrodlabs/acorn/releases) with the appropriate version tag.
56+
This will create an `acorn.webhapp` file in the `./happs/happ/workdir` directory.
5557

56-
Publish this to the weave tool curation list, following the instruction [here](https://github.com/lightningrodlabs/weave-tool-curation/blob/main/0.13/README.md). You can view an example PR of this [here](https://github.com/lightningrodlabs/weave-tool-curation/pull/40).
58+
Then publish this to the weave tool curation list, following the instruction [here](https://github.com/lightningrodlabs/weave-tool-curation/blob/main/0.14/README.md). You can view an example PR of this [here](https://github.com/lightningrodlabs/weave-tool-curation/pull/40).
5759

5860
### Versioning
5961

happs/CODE_OF_CONDUCT.md

Lines changed: 0 additions & 128 deletions
This file was deleted.

happs/CONTRIBUTING.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

happs/DEVELOPERS.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

happs/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
# Acorn hApp
22

3-
This repository is home to the holochain hApp definitions, DNA definitions and Zome Rust/WASM code.
4-
5-
This repository is used just for developing and releasing the two hApp files that Acorn consists of: Profiles, and Projects.
6-
7-
The main repository for the end-user application is [Acorn](https://github.com/lightningrodlabs/acorn).
8-
9-
- Are you a developer? [Read on](./DEVELOPERS.md).
10-
11-
© 2020-2023 Harris-Braun Enterprises, LLC, operating as [Lightningrod Labs](https://lightningrodlabs.org). Licensed under the [Cryptographic Autonomy License v1.0](https://opensource.org/licenses/CAL-1.0).
3+
This folder is home to the holochain hApp definitions, DNA definitions and Zome Rust/WASM code.

happs/happ/workdir/dna/profiles/dna.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

happs/happ/workdir/profiles/happ.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

happs/happ/workdir/projects/happ.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

happs/happ/workdir/web-happ.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
manifest_version: '1'
3-
name: acorn-desktop
3+
name: acorn
44
ui:
55
bundled: '../../../web/dist.zip'
66
happ_manifest:

0 commit comments

Comments
 (0)