diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9c4a461..72dbfd2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,6 @@ jobs: check: uses: fizzyedit/plugin-build-action/.github/workflows/check.yml@v7 with: - zig-version: "0.16.0" + zig-version: "0.17.0" secrets: build_env: ${{ secrets.DRIVE_BUILD_ENV }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec569275..c9a9e6e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,6 +28,6 @@ jobs: permissions: contents: write with: - zig-version: "0.16.0" + zig-version: "0.17.0" secrets: build_env: ${{ secrets.DRIVE_BUILD_ENV }} diff --git a/.github/workflows/sdk-repin.yml b/.github/workflows/sdk-repin.yml index 085116b7..d27cc87d 100644 --- a/.github/workflows/sdk-repin.yml +++ b/.github/workflows/sdk-repin.yml @@ -31,6 +31,6 @@ jobs: with: sdk-version: ${{ github.event.client_payload.version || inputs.sdk-version || '' }} force: ${{ inputs.force == true }} - zig-version: "0.16.0" + zig-version: "0.17.0" secrets: build_env: ${{ secrets.DRIVE_BUILD_ENV }} diff --git a/build.zig b/build.zig index 531b7150..6455f829 100644 --- a/build.zig +++ b/build.zig @@ -27,7 +27,10 @@ pub fn build(b: *std.Build) void { /// strings when those are unset too, which builds a plugin that can only say "not configured". fn ensureCredentials(b: *std.Build) void { const io = b.graph.io; - if (b.build_root.handle.access(io, "credentials.zon", .{})) |_| return else |_| {} + // Declared either way, so a credentials.zon edited later reconfigures. The environment is + // read only to write a missing one: Zig 0.17 caches the configuration without regard to it. + defer b.dependOnFileContents(b.path("credentials.zon")); + if (b.root.access(io, "credentials.zon", .{})) |_| return else |_| {} const id = b.graph.environ_map.get("FIZZY_DRIVE_CLIENT_ID") orelse ""; const secret = b.graph.environ_map.get("FIZZY_DRIVE_CLIENT_SECRET") orelse ""; const web_id = b.graph.environ_map.get("FIZZY_DRIVE_WEB_CLIENT_ID") orelse ""; @@ -40,7 +43,8 @@ fn ensureCredentials(b: *std.Build) void { \\}} \\ , .{ id, secret, web_id }); - b.build_root.handle.writeFile(io, .{ .sub_path = "credentials.zon", .data = text }) catch |err| { + const path = b.root.joinString(b.allocator, "credentials.zon") catch @panic("OOM"); + std.Io.Dir.cwd().writeFile(io, .{ .sub_path = path, .data = text }) catch |err| { std.debug.panic("drive: could not write credentials.zon: {t}", .{err}); }; if (id.len == 0) std.debug.print("drive: no credentials.zon and FIZZY_DRIVE_CLIENT_ID unset — the plugin will refuse to sign in until one is provided\n", .{}); diff --git a/build.zig.zon b/build.zig.zon index dac51baa..6a36d55a 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,7 +1,7 @@ .{ .name = .drive, .version = "0.1.0", - .minimum_zig_version = "0.16.0", + .minimum_zig_version = "0.17.0", .paths = .{ "build.zig", "build.zig.zon", @@ -26,8 +26,8 @@ // The published SDK, not a path into a checkout: a release has to build from a // clean clone, and the release asset (never the tag's git archive) is the SDK // package alone — the monorepo root zon carries the app's own dependencies. - .url = "https://github.com/fizzyedit/fizzy/releases/download/sdk-v0.2.29/fizzy-sdk-v0.2.29.tar.gz", - .hash = "fizzy-0.2.29-SGBwY2sxJgCLLSPt4HLdlMSg7WtcP4K0fdtXI5WwJl2d", + .url = "https://github.com/fizzyedit/fizzy/releases/download/sdk-v0.2.30/fizzy-sdk-v0.2.30.tar.gz", + .hash = "fizzy-0.2.30-SGBwY1QnJwDznUMVnSLATxXgH2e8_Vz7eMwLj9UQ0sVU", }, }, } diff --git a/plugin.zig.zon b/plugin.zig.zon index 12bfbb18..bdcd09a0 100644 --- a/plugin.zig.zon +++ b/plugin.zig.zon @@ -1,8 +1,8 @@ .{ .id = "drive", .name = "Google Drive", - .version = "0.1.17", - .min_sdk_version = "0.2.29", + .version = "0.1.18", + .min_sdk_version = "0.2.30", .description = "Sign in to Google Drive and browse, open and edit it in the explorer like a folder", .tags = .{ "cloud", "drive", "mount" }, .author = "foxnne",