gpu-dawn: abide by GitHub release filename restrictions
GitHub releases impose [some weird restrictions on uploaded filenames](https://twitter.com/slimsag/status/1498025997987315713), so we now abide by those. Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
d5682a2cd3
commit
85dbc406ff
3 changed files with 19 additions and 15 deletions
12
gpu-dawn/.github/workflows/ci.yml
vendored
12
gpu-dawn/.github/workflows/ci.yml
vendored
|
|
@ -91,9 +91,9 @@ jobs:
|
|||
AGREE: true
|
||||
- name: upload (debug)
|
||||
run: |
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12.1...12.1-gnu_debug.a
|
||||
gzip -9 zig-out/lib/libdawn_x86_64-macos.12.1...12.1-gnu_debug.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12.1...12.1-gnu_debug.a.gz
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_debug.a
|
||||
gzip -9 zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_debug.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_debug.a.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
x86_64-macos_release-fast:
|
||||
|
|
@ -116,8 +116,8 @@ jobs:
|
|||
AGREE: true
|
||||
- name: upload (release-fast)
|
||||
run: |
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12.1...12.1-gnu_release-fast.a
|
||||
gzip -9 zig-out/lib/libdawn_x86_64-macos.12.1...12.1-gnu_release-fast.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12.1...12.1-gnu_release-fast.a.gz
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_release-fast.a
|
||||
gzip -9 zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_release-fast.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_x86_64-macos.12.1---12.1-gnu_release-fast.a.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
12
gpu-dawn/.github/workflows/m1_ci.yml
vendored
12
gpu-dawn/.github/workflows/m1_ci.yml
vendored
|
|
@ -29,9 +29,9 @@ jobs:
|
|||
AGREE: true
|
||||
- name: upload (debug)
|
||||
run: |
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12.1...12.1-gnu_debug.a
|
||||
gzip -9 zig-out/lib/libdawn_aarch64-macos.12.1...12.1-gnu_debug.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12.1...12.1-gnu_debug.a.gz
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_debug.a
|
||||
gzip -9 zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_debug.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_debug.a.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: install (release-fast)
|
||||
|
|
@ -40,8 +40,8 @@ jobs:
|
|||
AGREE: true
|
||||
- name: upload (release-fast)
|
||||
run: |
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12.1...12.1-gnu_release-fast.a
|
||||
gzip -9 zig-out/lib/libdawn_aarch64-macos.12.1...12.1-gnu_release-fast.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12.1...12.1-gnu_release-fast.a.gz
|
||||
mv zig-out/lib/libdawn.a zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_release-fast.a
|
||||
gzip -9 zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_release-fast.a
|
||||
gh release upload "release-$(git rev-parse --short HEAD)" zig-out/lib/libdawn_aarch64-macos.12.1---12.1-gnu_release-fast.a.gz
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ pub fn linkFromBinary(b: *Builder, step: *std.build.LibExeObjStep, options: Opti
|
|||
}
|
||||
}
|
||||
|
||||
pub fn ensureBinaryDownloaded(allocator: std.mem.Allocator, triple: []const u8, is_release: bool, version: []const u8) void {
|
||||
pub fn ensureBinaryDownloaded(allocator: std.mem.Allocator, zig_triple: []const u8, is_release: bool, version: []const u8) void {
|
||||
// If zig-cache/mach/gpu-dawn/<git revision> does not exist:
|
||||
// If on a commit in the main branch => rm -r zig-cache/mach/gpu-dawn/
|
||||
// else => noop
|
||||
|
|
@ -253,7 +253,7 @@ pub fn ensureBinaryDownloaded(allocator: std.mem.Allocator, triple: []const u8,
|
|||
}
|
||||
|
||||
const release_tag = if (is_release) "release-fast" else "debug";
|
||||
const target_cache_dir = std.fs.path.join(allocator, &.{ commit_cache_dir, triple, release_tag }) catch unreachable;
|
||||
const target_cache_dir = std.fs.path.join(allocator, &.{ commit_cache_dir, zig_triple, release_tag }) catch unreachable;
|
||||
if (dirExists(target_cache_dir)) {
|
||||
return; // nothing to do, already have the binary
|
||||
}
|
||||
|
|
@ -261,13 +261,17 @@ pub fn ensureBinaryDownloaded(allocator: std.mem.Allocator, triple: []const u8,
|
|||
const download_dir = std.fs.path.join(allocator, &.{ target_cache_dir, "download" }) catch unreachable;
|
||||
std.fs.cwd().makePath(download_dir) catch unreachable;
|
||||
|
||||
// Replace "..." with "---" because GitHub releases has very weird restrictions on file names.
|
||||
// https://twitter.com/slimsag/status/1498025997987315713
|
||||
const github_triple = std.mem.replaceOwned(u8, allocator, zig_triple, "...", "---") catch unreachable;
|
||||
|
||||
// Compose the download URL, e.g.:
|
||||
// https://github.com/hexops/mach-gpu-dawn/releases/download/release-2e5a4eb/libdawn_x86_64-macos_debug.a.gz
|
||||
const download_url = std.mem.concat(allocator, u8, &.{
|
||||
"https://github.com/hexops/mach-gpu-dawn/releases/download/",
|
||||
version,
|
||||
"/libdawn_",
|
||||
triple,
|
||||
github_triple,
|
||||
"_",
|
||||
release_tag,
|
||||
".a.gz",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue