Skip to content

Commit f11f43e

Browse files
committed
Update readme and CD
1 parent 753a815 commit f11f43e

File tree

4 files changed

+27
-34
lines changed

4 files changed

+27
-34
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ jobs:
1818
uses: cloudflare/wrangler-action@v3
1919
with:
2020
apiToken: ${{ secrets.CF_API_TOKEN }}
21+
secrets: |
22+
GITHUB_TOKEN
2123
env:
2224
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ dist
22
node_modules
33
transpiled
44
/.idea/
5-
5+
.dev.vars
66
.wrangler/

README.md

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,35 @@
11
# Tauri Update Server: Cloudflare
22

3-
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](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.
45

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`)
910

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.
1112

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
1325
### Tauri >= v1.0.0-rc5:
1426

1527
use `https://your-update-server.com/v1` route
1628

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).
1830

1931
### Legacy
2032
use `https://your-update-server.com/`
2133

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).

wrangler.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ main = "src/index.ts"
55

66
[vars]
77
GITHUB_ACCOUNT = 'killeencode'
8-
GITHUB_REPO = 'brancato'
9-
GITHUB_TOKEN = '' # Optional - used with private repos
8+
GITHUB_REPO = 'brancato'

0 commit comments

Comments
 (0)