From 82da3e8052cbac9adb3633f2fc58b97947bf39f9 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 19:30:34 +0400 Subject: [PATCH 01/15] wip on tauri release --- .github/workflows/tauri-release.yml | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/tauri-release.yml diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml new file mode 100644 index 000000000..10bead113 --- /dev/null +++ b/.github/workflows/tauri-release.yml @@ -0,0 +1,48 @@ +name: 'publish' + +# This will trigger the action on each push to the `release` branch. +on: + push: + branches: + - main + - 2024-01-23-tauri-build + +jobs: + publish-tauri: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + platform: [macos-latest, ubuntu-20.04, windows-latest] + + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v4 + + - name: setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: install Rust stable + uses: dtolnay/rust-toolchain@stable + + - name: install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-20.04' + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf + + - name: install frontend dependencies + run: yarn install # change this to npm or pnpm depending on which one you use + + - uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version + releaseName: 'App v__VERSION__' + releaseBody: 'See the assets to download this version and install.' + releaseDraft: true + prerelease: false \ No newline at end of file From d9e8eb6f865965220ebf8fd50e5273861f41baa3 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 19:42:06 +0400 Subject: [PATCH 02/15] add nix to tauri build --- .github/workflows/tauri-release.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 10bead113..1e6ba76e2 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -19,6 +19,16 @@ jobs: runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + - run: nix run .#rainix-sol-prelude + - run: nix run .#rainix-rs-prelude - name: setup node uses: actions/setup-node@v4 From b6ac0dce84e853e42065ddc4aef71c5dc94b9e3b Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 20:23:48 +0400 Subject: [PATCH 03/15] install rust via nix for tauri build --- .github/workflows/tauri-release.yml | 14 +++++++++++--- flake.nix | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 1e6ba76e2..4a14d20f7 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -14,7 +14,12 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-latest, ubuntu-20.04, windows-latest] + platform: [ + macos-latest, + ubuntu-20.04 + # Someone who cares can make windows work. + # windows-latest + ] runs-on: ${{ matrix.platform }} steps: @@ -35,8 +40,11 @@ jobs: with: node-version: 20 - - name: install Rust stable - uses: dtolnay/rust-toolchain@stable + - name: install rust + run: nix profile install .#rust-toolchain.$(nix eval --impure --raw --expr 'builtins.currentSystem') + + # - name: install Rust stable + # uses: dtolnay/rust-toolchain@stable - name: install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-20.04' diff --git a/flake.nix b/flake.nix index d34acc2b7..5471d0e11 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ let pkgs = rainix.pkgs.${system}; in { + rust-toolchain = rainix.rust-toolchain.${system}; packages = rec { ob-tauri-prelude = rainix.mkTask.${system} { name = "ob-tauri-prelude"; From e5448b475c17c35a446a45d512d404575b0db446 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 20:49:07 +0400 Subject: [PATCH 04/15] tauri release env --- .github/workflows/tauri-release.yml | 2 +- flake.nix | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 4a14d20f7..3cbc8c1cf 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -41,7 +41,7 @@ jobs: node-version: 20 - name: install rust - run: nix profile install .#rust-toolchain.$(nix eval --impure --raw --expr 'builtins.currentSystem') + run: nix profile install .#tauri-release-env # - name: install Rust stable # uses: dtolnay/rust-toolchain@stable diff --git a/flake.nix b/flake.nix index 5471d0e11..6e6f40367 100644 --- a/flake.nix +++ b/flake.nix @@ -11,8 +11,12 @@ let pkgs = rainix.pkgs.${system}; in { - rust-toolchain = rainix.rust-toolchain.${system}; packages = rec { + tauri-release-env = pkgs.buildEnv { + name = "Tauri release environment"; + paths = rainix.rust-build-inputs.${system}; + }; + ob-tauri-prelude = rainix.mkTask.${system} { name = "ob-tauri-prelude"; body = '' From 8cafcabf6bdd6702655e329488d720a413ae8012 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 21:07:35 +0400 Subject: [PATCH 05/15] more nix for tauri release --- .github/workflows/tauri-release.yml | 17 +++++------------ flake.lock | 7 ++++--- flake.nix | 8 +++----- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 3cbc8c1cf..49bc0e89f 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -32,28 +32,21 @@ jobs: uses: DeterminateSystems/nix-installer-action@v4 - uses: DeterminateSystems/magic-nix-cache-action@v2 - - run: nix run .#rainix-sol-prelude - - run: nix run .#rainix-rs-prelude - - - name: setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: install rust run: nix profile install .#tauri-release-env - # - name: install Rust stable - # uses: dtolnay/rust-toolchain@stable - - name: install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-20.04' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf + - run: nix run .#rainix-sol-prelude + - run: nix run .#rainix-rs-prelude + - name: install frontend dependencies - run: yarn install # change this to npm or pnpm depending on which one you use + run: npm install + working-directory: ./tauri-app - uses: tauri-apps/tauri-action@v0 env: diff --git a/flake.lock b/flake.lock index ded469b5d..6c0e41173 100644 --- a/flake.lock +++ b/flake.lock @@ -230,16 +230,17 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1705721052, - "narHash": "sha256-bLXm81a98dujI3xwKsSQMB5/3d9fPJalIQyn/PzpcBo=", + "lastModified": 1706029304, + "narHash": "sha256-T4MirSX4H0JjiB4uLlVblCwN25+rVOVGeptbmDdiE9A=", "owner": "rainprotocol", "repo": "rainix", - "rev": "f0a66d3f0e12d8af1c1c0a1cb1e1704b77452f3e", + "rev": "9fee1bef10be721d149b202da7378365540a3578", "type": "github" }, "original": { "owner": "rainprotocol", "repo": "rainix", + "rev": "9fee1bef10be721d149b202da7378365540a3578", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 6e6f40367..400bca895 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Flake for development workflows."; inputs = { - rainix.url = "github:rainprotocol/rainix"; + rainix.url = "github:rainprotocol/rainix/9fee1bef10be721d149b202da7378365540a3578"; flake-utils.url = "github:numtide/flake-utils"; }; @@ -12,10 +12,8 @@ pkgs = rainix.pkgs.${system}; in { packages = rec { - tauri-release-env = pkgs.buildEnv { - name = "Tauri release environment"; - paths = rainix.rust-build-inputs.${system}; - }; + + tauri-release-env = rainix.tauri-release-env.${system}; ob-tauri-prelude = rainix.mkTask.${system} { name = "ob-tauri-prelude"; From b00321dda52672e71be9d4917bf80e10987056e6 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 21:11:45 +0400 Subject: [PATCH 06/15] include sha in tag for github --- .github/workflows/tauri-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 49bc0e89f..872f6a939 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -52,8 +52,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version - releaseName: 'App v__VERSION__' + tagName: app-v__VERSION__-${{ github.sha }} # the action automatically replaces \_\_VERSION\_\_ with the app version + releaseName: 'App v__VERSION__-${{ github.sha }}' releaseBody: 'See the assets to download this version and install.' releaseDraft: true prerelease: false \ No newline at end of file From 4641e0bc556e0a7ca6e3d17585639f6cbffcef2d Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 21:25:59 +0400 Subject: [PATCH 07/15] remove unnecessary build step for tauri release --- .github/workflows/tauri-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 872f6a939..94fa4addc 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -41,8 +41,8 @@ jobs: sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf + # Need to prebuild the sol artifacts so that rust can find them. - run: nix run .#rainix-sol-prelude - - run: nix run .#rainix-rs-prelude - name: install frontend dependencies run: npm install From 5deb6e4f624a105f01ab6dc315eee7af325804c5 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 21:28:58 +0400 Subject: [PATCH 08/15] set projectPath for tauri release --- .github/workflows/tauri-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 94fa4addc..f48ff30e6 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -52,6 +52,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + projectPath: ./tauri-app tagName: app-v__VERSION__-${{ github.sha }} # the action automatically replaces \_\_VERSION\_\_ with the app version releaseName: 'App v__VERSION__-${{ github.sha }}' releaseBody: 'See the assets to download this version and install.' From e8c527099c93c513875009ce5eb957d37739902f Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 21:34:51 +0400 Subject: [PATCH 09/15] add tauriScript --- .github/workflows/tauri-release.yml | 1 + flake.lock | 8 ++++---- flake.nix | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index f48ff30e6..9de408f34 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -53,6 +53,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: projectPath: ./tauri-app + tauriScript: 'cargo tauri' tagName: app-v__VERSION__-${{ github.sha }} # the action automatically replaces \_\_VERSION\_\_ with the app version releaseName: 'App v__VERSION__-${{ github.sha }}' releaseBody: 'See the assets to download this version and install.' diff --git a/flake.lock b/flake.lock index 6c0e41173..a3ec7690e 100644 --- a/flake.lock +++ b/flake.lock @@ -230,17 +230,17 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1706029304, - "narHash": "sha256-T4MirSX4H0JjiB4uLlVblCwN25+rVOVGeptbmDdiE9A=", + "lastModified": 1706031173, + "narHash": "sha256-UMTpX0T2RXJ1Hz3OpPAmiH+oHfZyvMCWDvBgSit1TmE=", "owner": "rainprotocol", "repo": "rainix", - "rev": "9fee1bef10be721d149b202da7378365540a3578", + "rev": "efd5bd6f2e5aa5db92fd73ffeb2053fb94391d45", "type": "github" }, "original": { "owner": "rainprotocol", "repo": "rainix", - "rev": "9fee1bef10be721d149b202da7378365540a3578", + "rev": "efd5bd6f2e5aa5db92fd73ffeb2053fb94391d45", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 400bca895..caead7eb2 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Flake for development workflows."; inputs = { - rainix.url = "github:rainprotocol/rainix/9fee1bef10be721d149b202da7378365540a3578"; + rainix.url = "github:rainprotocol/rainix/efd5bd6f2e5aa5db92fd73ffeb2053fb94391d45"; flake-utils.url = "github:numtide/flake-utils"; }; From 70f7675e2ccaa99a63ef0f5f863d4e7452808fbd Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 21:35:25 +0400 Subject: [PATCH 10/15] remove projectPath --- .github/workflows/tauri-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 9de408f34..830d9feda 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -52,7 +52,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - projectPath: ./tauri-app tauriScript: 'cargo tauri' tagName: app-v__VERSION__-${{ github.sha }} # the action automatically replaces \_\_VERSION\_\_ with the app version releaseName: 'App v__VERSION__-${{ github.sha }}' From b73184724b005e18acdc6af854f54845b17d602e Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 22:09:43 +0400 Subject: [PATCH 11/15] remove reduandant npm install --- .github/workflows/tauri-release.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 830d9feda..3d689f513 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -44,10 +44,6 @@ jobs: # Need to prebuild the sol artifacts so that rust can find them. - run: nix run .#rainix-sol-prelude - - name: install frontend dependencies - run: npm install - working-directory: ./tauri-app - - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From dbc58cfff9dc61cef8103f1b6a1a2bd0a974cb05 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 22:31:04 +0400 Subject: [PATCH 12/15] bump rainix --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index a3ec7690e..7234cedbf 100644 --- a/flake.lock +++ b/flake.lock @@ -230,17 +230,17 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1706031173, - "narHash": "sha256-UMTpX0T2RXJ1Hz3OpPAmiH+oHfZyvMCWDvBgSit1TmE=", + "lastModified": 1706034620, + "narHash": "sha256-MK4o0vjQEreGJSoyl25X+ahHMo7ow702VN7ycBc2FrM=", "owner": "rainprotocol", "repo": "rainix", - "rev": "efd5bd6f2e5aa5db92fd73ffeb2053fb94391d45", + "rev": "266ea9341fcedb917bec179faa0e9e7a1811c7e9", "type": "github" }, "original": { "owner": "rainprotocol", "repo": "rainix", - "rev": "efd5bd6f2e5aa5db92fd73ffeb2053fb94391d45", + "rev": "266ea9341fcedb917bec179faa0e9e7a1811c7e9", "type": "github" } }, diff --git a/flake.nix b/flake.nix index caead7eb2..2769c8876 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Flake for development workflows."; inputs = { - rainix.url = "github:rainprotocol/rainix/efd5bd6f2e5aa5db92fd73ffeb2053fb94391d45"; + rainix.url = "github:rainprotocol/rainix/266ea9341fcedb917bec179faa0e9e7a1811c7e9"; flake-utils.url = "github:numtide/flake-utils"; }; From 708789193d66765380f49b824ec1b723e62192ef Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 22:48:50 +0400 Subject: [PATCH 13/15] not draft tauri action --- .github/workflows/tauri-release.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 3d689f513..e1138341c 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -32,7 +32,7 @@ jobs: uses: DeterminateSystems/nix-installer-action@v4 - uses: DeterminateSystems/magic-nix-cache-action@v2 - - name: install rust + - name: install rainix tauri release env run: nix profile install .#tauri-release-env - name: install dependencies (ubuntu only) @@ -51,6 +51,4 @@ jobs: tauriScript: 'cargo tauri' tagName: app-v__VERSION__-${{ github.sha }} # the action automatically replaces \_\_VERSION\_\_ with the app version releaseName: 'App v__VERSION__-${{ github.sha }}' - releaseBody: 'See the assets to download this version and install.' - releaseDraft: true - prerelease: false \ No newline at end of file + releaseBody: 'See the assets to download this version and install.' \ No newline at end of file From 290e66243a9f5f56bce087577e1bd3c2af671ff0 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 22:49:10 +0400 Subject: [PATCH 14/15] tauri publish main --- .github/workflows/tauri-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index e1138341c..f6a1b019b 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -5,7 +5,6 @@ on: push: branches: - main - - 2024-01-23-tauri-build jobs: publish-tauri: From 2c7d264a77ff48ecc1ef610a900bf277cdd72b8b Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Tue, 23 Jan 2024 22:49:42 +0400 Subject: [PATCH 15/15] bump rainix --- flake.lock | 5 ++--- flake.nix | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 7234cedbf..905653663 100644 --- a/flake.lock +++ b/flake.lock @@ -230,17 +230,16 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1706034620, + "lastModified": 1706035670, "narHash": "sha256-MK4o0vjQEreGJSoyl25X+ahHMo7ow702VN7ycBc2FrM=", "owner": "rainprotocol", "repo": "rainix", - "rev": "266ea9341fcedb917bec179faa0e9e7a1811c7e9", + "rev": "246bf330f2bc8af10c121a329b4a909215b58e29", "type": "github" }, "original": { "owner": "rainprotocol", "repo": "rainix", - "rev": "266ea9341fcedb917bec179faa0e9e7a1811c7e9", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 2769c8876..e0f6fe438 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Flake for development workflows."; inputs = { - rainix.url = "github:rainprotocol/rainix/266ea9341fcedb917bec179faa0e9e7a1811c7e9"; + rainix.url = "github:rainprotocol/rainix"; flake-utils.url = "github:numtide/flake-utils"; };