From 12b16e57a1cd6e8402d45eb2ad019e8456ef76c2 Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Fri, 14 Jun 2024 15:44:05 +0200 Subject: [PATCH 1/2] Fix release workflow --- .github/workflows/release-tauri-app.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release-tauri-app.yaml b/.github/workflows/release-tauri-app.yaml index f4936dab..3da058e8 100644 --- a/.github/workflows/release-tauri-app.yaml +++ b/.github/workflows/release-tauri-app.yaml @@ -62,9 +62,8 @@ jobs: - name: build the app uses: tauri-apps/tauri-action@v0 env: - GITHUB_TOKEN: $ + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - projectPath: src-tauri tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version releaseName: "Relay v__VERSION__" releaseBody: "See assets below to download and install this version." From 7f4a11706f42ce7e69642eeedaa98dffd4a5eb2d Mon Sep 17 00:00:00 2001 From: "guillem.cordoba" Date: Fri, 14 Jun 2024 18:08:05 +0200 Subject: [PATCH 2/2] Release first builds happ, then fetches it to build the tauri apps --- .github/workflows/release-tauri-app.yaml | 68 ++++++++++++++++++++++-- src-tauri/tauri.conf.json | 2 +- ui/package.json | 14 ++--- 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-tauri-app.yaml b/.github/workflows/release-tauri-app.yaml index 3da058e8..e754664d 100644 --- a/.github/workflows/release-tauri-app.yaml +++ b/.github/workflows/release-tauri-app.yaml @@ -6,6 +6,57 @@ on: - 'v[0-9]+.[0-9]+.[0-9]+-dev.[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: Extend space + uses: ./.github/actions/extend-space + + - name: Install nix + uses: cachix/install-nix-action@v18 + with: + install_url: https://releases.nixos.org/nix/nix-2.13.3/install + extra_nix_config: | + experimental-features = flakes nix-command + + - uses: cachix/cachix-action@v12 + with: + name: holochain-ci + + - uses: cachix/cachix-action@v12 + with: + name: darksoil-studio + + - name: Install and test + run: | + nix-store --gc + nix develop --command bash -c "npm i && npm 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/relay.happ" + body: "See assets below to download and install this version." + name: Relay v${{ steps.version.outputs.APP_VERSION }} + tag: Relay-v${{ steps.version.outputs.APP_VERSION }} + prerelease: true + draft: true + release-tauri-app: strategy: fail-fast: false @@ -33,6 +84,7 @@ jobs: with: override: true toolchain: stable + - name: install Go stable uses: actions/setup-go@v4 with: @@ -59,13 +111,23 @@ jobs: run: | npm install + - name: Download release of the .happ + id: release_data + uses: KevinRohn/github-full-release-data@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + repository: "holochain-apps/volla-chat" + token: ${{ secrets.GITHUB_TOKEN }} + version: Relay-v${{ needs.publish-happ.outputs.appVersion }} + asset-file: '*.happ' + asset-output: '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: "Relay v__VERSION__" - releaseBody: "See assets below to download and install this version." + releaseId: ${{ needs.publish-happ.outputs.releaseId }} releaseDraft: true prerelease: true diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 132fcf8f..f7403f94 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -3,7 +3,7 @@ "version": "0.0.1-dev.2", "identifier": "org.holochain.relay", "build": { - "beforeBuildCommand": "npm run build -w ui && npm run build:happ", + "beforeBuildCommand": "npm run build -w ui", "devUrl": "http://localhost:1420", "frontendDist": "../ui/build" }, diff --git a/ui/package.json b/ui/package.json index 3a7ec143..2676a0bd 100644 --- a/ui/package.json +++ b/ui/package.json @@ -12,14 +12,14 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "prettier --plugin-search-dir . --check . && eslint .", "format": "prettier --plugin-search-dir . --write .", - "package": "rm -f dist.zip && npm run build && cd dist && bestzip ../dist.zip *" + "package": "rm -f dist.zip && npm run build && cd build && bestzip ../dist.zip *" }, "devDependencies": { - "@holochain/client": "=0.17.0-rc.0", - "@holochain-open-dev/profiles": "^0.400.0-dev.1", - "@holochain-open-dev/utils": "^0.300.0-rc.0", - "@holochain-open-dev/elements": "^0.300.0-rc.0", - "@skeletonlabs/skeleton": "^2.8.0", + "@holochain/client": "=0.17.0-rc.0", + "@holochain-open-dev/profiles": "^0.400.0-dev.1", + "@holochain-open-dev/utils": "^0.300.0-rc.0", + "@holochain-open-dev/elements": "^0.300.0-rc.0", + "@skeletonlabs/skeleton": "^2.8.0", "@skeletonlabs/tw-plugin": "^0.3.1", "@sveltejs/adapter-static": "^3.0.0", "@sveltejs/kit": "^2.5.10", @@ -50,4 +50,4 @@ "dependencies": { "@tauri-apps/api": "2.0.0-beta.13" } -} \ No newline at end of file +}