Skip to content

Commit d1eddd6

Browse files
committed
build: corrected release script
1 parent 8f0c4ad commit d1eddd6

File tree

4 files changed

+31
-23
lines changed

4 files changed

+31
-23
lines changed

.github/workflows/check.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: check
22

33
on:
4-
push:
54
pull_request:
65

76
jobs:

.github/workflows/release.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,65 @@
11
name: Release
2-
32
env:
43
PACKAGE_NAME: "mcp-server-drupal"
54
TARGET_LIST: "x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,x86_64-pc-windows-msvc,x86_64-apple-darwin,aarch64-apple-darwin"
6-
75
on:
86
push:
97
tags:
108
- "v*.*.*"
11-
129
permissions:
1310
contents: write
1411
id-token: write
15-
1612
jobs:
1713
build-and-sign:
1814
runs-on: ubuntu-latest
1915
steps:
2016
- name: Checkout code
2117
uses: actions/checkout@v4
22-
2318
- name: Setup Deno
2419
uses: denoland/setup-deno@v2
2520
with:
2621
deno-version: "2.x"
27-
2822
- name: Extract version from tag
2923
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
30-
3124
- name: Setup cosign
3225
uses: sigstore/[email protected]
33-
3426
- name: Build the binaries
3527
run: |
3628
for target in $(echo $TARGET_LIST | tr "," "\n")
3729
do
38-
binary_name=$(echo $target | sed "s/^deno-/$PACKAGE_NAME-/" | sed "s/-/_/g")
39-
deno compile --target=$target --output=./build/$binary_name ./src/index.ts
40-
done
30+
arch=$(echo $target | cut -d'-' -f1)
31+
os=$(echo $target | cut -d'-' -f2)
32+
33+
case $arch in
34+
"x86_64") arch_name="x86" ;;
35+
"aarch64") arch_name="arm" ;;
36+
*) arch_name=$arch ;;
37+
esac
38+
39+
case $os in
40+
"apple") os_name="darwin" ;;
41+
"unknown") os_name="linux" ;;
42+
"pc") os_name="windows" ;;
43+
*) os_name=$os ;;
44+
esac
45+
46+
binary_name="${PACKAGE_NAME}_${os_name}_${arch_name}"
4147
42-
- name: Sign binaries with Sigstore Keyless
48+
deno task build --target=$target --output=./build/$binary_name
49+
done
50+
- name: Sign binaries
4351
run: |
44-
for file in build/*
45-
do
46-
cosign sign-blob
47-
\ --yes
48-
\ build/$file
49-
\ --bundle build/$file.sigstore
52+
mkdir -p build/bundles
53+
54+
for file in build/*; do
55+
if [[ "$file" == "build/bundles" ]]; then continue; fi
56+
base_name=$(basename "$file" .exe)
57+
cosign sign-blob --bundle "build/bundles/${base_name}.bundle" --yes "$file"
5058
done
5159
60+
cd build/bundles
61+
tar -czf ../signatures.tar.gz *
62+
cd ../..
5263
- name: Release
5364
uses: softprops/action-gh-release@v2
5465
with:

deno.jsonc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"lint": "deno lint",
77
"build": "deno run --allow-read --allow-net --allow-env --allow-run scripts/build.ts",
88
"inspector": "npx @modelcontextprotocol/inspector build/mcp-server-drupal",
9-
"release": "deno run npm:release-it"
9+
"release": "deno run -A npm:release-it"
1010
},
1111
"compilerOptions": {
1212
"strict": true,
@@ -23,7 +23,6 @@
2323
"@std/fmt": "jsr:@std/fmt@^1.0.3",
2424
"@std/fs": "jsr:@std/fs@^1.0.8",
2525
"@std/path": "jsr:@std/path@^1.0.8",
26-
"release-it": "npm:release-it@^18.0.0",
2726
"zod": "npm:zod@^3.24.1"
2827
}
2928
}

deno.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)