Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/sdk-repin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
8 changes: 6 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
Expand All @@ -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", .{});
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
},
},
}
4 changes: 2 additions & 2 deletions plugin.zig.zon
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Loading