|
1 | 1 | # Tauri Update Server: Cloudflare
|
2 | 2 |
|
3 |
| -[](https://deploy.workers.cloudflare.com/?url=https://github.com/killeencode/tauri-update-cloudflare) |
| 3 | +## Overview |
| 4 | +This tool allows you to easily take advantage of Tauri's dynamic update server capabilities using Cloudflare Workers. This project is a fork of [KilleenCode/tauri-update-cloudflare](https://github.com/KilleenCode/tauri-update-cloudflare), which hasn't been maintained for a while. This fork aims to keep the project up-to-date with the latest Tauri and Cloudflare Workers APIs. |
4 | 5 |
|
5 |
| -## One-Click Deploy |
6 |
| -1. Click the button above, let Cloudflare walk you through: it's easy! |
7 |
| -2. Go to your forked repository, edit `wrangler.toml`: |
8 |
| - - Update `GITHUB_ACCOUNT` and `GITHUB_REPO` to point to the Tauri project you're publishing releases from |
| 6 | +## Configuration |
| 7 | +Wrangler.toml variables: |
| 8 | +- `GITHUB_ACCOUNT`: GitHub account name (e.g. `mackenly`) |
| 9 | +- `GITHUB_REPO`: GitHub repository name (e.g. `my-tauri-app`) |
9 | 10 |
|
10 |
| -Much credit to [@lemarier](https://github.com/lemarier) for the underlying logic at https://github.com/lemarier/updater-deno |
| 11 | +This project works with private GitHub repositories. To enable this, you need to set the `GITHUB_TOKEN` secret in your GitHub repository and it will be picked up by the deployment action. Alternatively, add the secret [manually](https://developers.cloudflare.com/workers/configuration/secrets/#add-secrets-to-your-project). This token should have the `repo` permission. |
11 | 12 |
|
12 |
| -## Tauri Version Support |
| 13 | +## Deployment |
| 14 | +### With CI/CD GitHub Actions |
| 15 | +CI/CD via GitHub Actions is set up to test and lint the code. CD requires the repository owner to set two repository secrets: |
| 16 | +- `CF_API_TOKEN` - Cloudflare API token (requires 'Edit Cloudflare Workers' permission template) |
| 17 | +- `CF_ACCOUNT_ID` - Cloudflare account ID |
| 18 | + |
| 19 | +### Manual Deployment |
| 20 | +1. Install dependencies: `npm install` and ensure `wrangler` [is installed](https://developers.cloudflare.com/workers/wrangler/install-and-update/). |
| 21 | +2. Run `npm run test` to ensure the code is working as expected. |
| 22 | +3. Run `wrangler publish` to deploy the code to Cloudflare Workers. |
| 23 | + |
| 24 | +## Usage with Tauri |
13 | 25 | ### Tauri >= v1.0.0-rc5:
|
14 | 26 |
|
15 | 27 | use `https://your-update-server.com/v1` route
|
16 | 28 |
|
17 |
| -For example usage, see [Brancato config](https://github.com/KilleenCode/brancato/blob/main/src-tauri/tauri.conf.json#L55) |
| 29 | +Read the [Tauri documentation](https://tauri.app/v1/guides/distribution/updater#tauri-configuration) for more information. For an example usage, see [Brancato config](https://github.com/KilleenCode/brancato/blob/main/src-tauri/tauri.conf.json#L55). |
18 | 30 |
|
19 | 31 | ### Legacy
|
20 | 32 | use `https://your-update-server.com/`
|
21 | 33 |
|
22 |
| -## Cloudflare Wrangler |
23 |
| - |
24 |
| -### 👩 💻 Developing |
25 |
| - |
26 |
| -`wrangler dev` |
27 |
| - |
28 |
| -[`src/index.ts`](./src/index.ts) calls the request handler in [`src/handler.ts`](./src/handler.ts), and will return the [request method](https://developer.mozilla.org/en-US/docs/Web/API/Request/method) for the given request. |
29 |
| - |
30 |
| -### 🧪 Testing |
31 |
| - |
32 |
| -This template comes with jest tests which simply test that the request handler can handle each request method. `npm test` will run your tests. |
33 |
| - |
34 |
| -### 👀 Previewing and Publishing |
35 |
| - |
36 |
| -`wrangler preview` |
37 |
| -`wrangler publish` |
38 |
| - |
39 |
| -For information on how to preview and publish your worker, please see the [Wrangler docs](https://developers.cloudflare.com/workers/tooling/wrangler/commands/#publish). |
40 |
| - |
41 |
| - |
42 |
| -## Private repos |
43 |
| - |
44 |
| -In order to work with private repos you need to set `GITHUB_TOKEN` variable to your `wrangler.toml` file. You can create a [personal access token here](https://github.com/settings/tokens/new), create it with the repo permissions. |
| 34 | +## Disclaimer |
| 35 | +Not affiliated with Rust, Tauri, or Cloudflare. Use at your own risk and follow the [license](./LICENSE). |
0 commit comments