-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript-release.sh
More file actions
26 lines (21 loc) · 777 Bytes
/
Copy pathscript-release.sh
File metadata and controls
26 lines (21 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
set -e
# Get package info
PACKAGE_NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
ARCHIVE_NAME="${PACKAGE_NAME}-${VERSION}.tar.gz"
echo "Creating release for ${PACKAGE_NAME} v${VERSION}..."
# Create archive
tar -czf "${ARCHIVE_NAME}" -C dist .
# Create release
gh release create "v${VERSION}" \
"${ARCHIVE_NAME}" \
--title "Release v${VERSION}" \
--notes "Automated release of ${PACKAGE_NAME} v${VERSION}" \
--generate-notes
echo "Release created! Download with:"
echo "wget https://github.com/dsfaccini/cloudflare-nodes/releases/download/v${VERSION}/${ARCHIVE_NAME}"
echo "Extract with: (assuming folder exists)"
echo "tar -xzf ${ARCHIVE_NAME} -C ${PACKAGE_NAME}"
# Cleanup
rm "${ARCHIVE_NAME}"