Skip to content

Commit

Permalink
build: corrected release script
Browse files Browse the repository at this point in the history
  • Loading branch information
GGKapanadze committed Jan 9, 2025
1 parent 8f0c4ad commit d1eddd6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
1 change: 0 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: check

on:
push:
pull_request:

jobs:
Expand Down
47 changes: 29 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,65 @@
name: Release

env:
PACKAGE_NAME: "mcp-server-drupal"
TARGET_LIST: "x86_64-unknown-linux-gnu,aarch64-unknown-linux-gnu,x86_64-pc-windows-msvc,x86_64-apple-darwin,aarch64-apple-darwin"

on:
push:
tags:
- "v*.*.*"

permissions:
contents: write
id-token: write

jobs:
build-and-sign:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: "2.x"

- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Setup cosign
uses: sigstore/[email protected]

- name: Build the binaries
run: |
for target in $(echo $TARGET_LIST | tr "," "\n")
do
binary_name=$(echo $target | sed "s/^deno-/$PACKAGE_NAME-/" | sed "s/-/_/g")
deno compile --target=$target --output=./build/$binary_name ./src/index.ts
done
arch=$(echo $target | cut -d'-' -f1)
os=$(echo $target | cut -d'-' -f2)
case $arch in
"x86_64") arch_name="x86" ;;
"aarch64") arch_name="arm" ;;
*) arch_name=$arch ;;
esac
case $os in
"apple") os_name="darwin" ;;
"unknown") os_name="linux" ;;
"pc") os_name="windows" ;;
*) os_name=$os ;;
esac
binary_name="${PACKAGE_NAME}_${os_name}_${arch_name}"
- name: Sign binaries with Sigstore Keyless
deno task build --target=$target --output=./build/$binary_name
done
- name: Sign binaries
run: |
for file in build/*
do
cosign sign-blob
\ --yes
\ build/$file
\ --bundle build/$file.sigstore
mkdir -p build/bundles
for file in build/*; do
if [[ "$file" == "build/bundles" ]]; then continue; fi
base_name=$(basename "$file" .exe)
cosign sign-blob --bundle "build/bundles/${base_name}.bundle" --yes "$file"
done
cd build/bundles
tar -czf ../signatures.tar.gz *
cd ../..
- name: Release
uses: softprops/action-gh-release@v2
with:
Expand Down
3 changes: 1 addition & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"lint": "deno lint",
"build": "deno run --allow-read --allow-net --allow-env --allow-run scripts/build.ts",
"inspector": "npx @modelcontextprotocol/inspector build/mcp-server-drupal",
"release": "deno run npm:release-it"
"release": "deno run -A npm:release-it"
},
"compilerOptions": {
"strict": true,
Expand All @@ -23,7 +23,6 @@
"@std/fmt": "jsr:@std/fmt@^1.0.3",
"@std/fs": "jsr:@std/fs@^1.0.8",
"@std/path": "jsr:@std/path@^1.0.8",
"release-it": "npm:release-it@^18.0.0",
"zod": "npm:zod@^3.24.1"
}
}
3 changes: 1 addition & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1eddd6

Please sign in to comment.