-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·57 lines (47 loc) · 1.76 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·57 lines (47 loc) · 1.76 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -euo pipefail
APP_NAME="WriteUpProject"
PROJECT_PATH="WriteUpProject.Desktop/WriteUpProject.Desktop.csproj"
VERSION="0.1.0"
RUNTIME="linux-x64"
PUBLISH_DIR="dist/${RUNTIME}"
echo "=== Cleaning up ==="
rm -rf "/home/adam/Desktop/WriteUpApp/${PUBLISH_DIR}"
mkdir "/home/adam/Desktop/WriteUpApp/dist"
mkdir "/home/adam/Desktop/WriteUpApp/${PUBLISH_DIR}"
echo "=== Publishing ${APP_NAME} for ${RUNTIME} ==="
dotnet publish "${PROJECT_PATH}" \
-c Release \
-r ${RUNTIME} \
--self-contained true \
-p:PublishSingleFile=true \
-p:PublishTrimmed=true \
-o "${PUBLISH_DIR}"
# --- TAR.GZ package ---
echo "=== Creating tar.gz package ==="
# cd "$PUBLISH_DIR"
tar -czf dist/"${APP_NAME}-${VERSION}-${RUNTIME}.tar.gz" "$PUBLISH_DIR"/*
cd ..
# --- DEB package ---
echo "=== Creating deb package ==="
PKG_DIR="deb_pkg"
DEB_NAME="${APP_NAME}_${VERSION}_amd64.deb"
rm -rf "/home/adam/Desktop/WriteUpApp/dist/${PKG_DIR}"
mkdir -p "/home/adam/Desktop/WriteUpApp/dist/${PKG_DIR}/DEBIAN"
mkdir -p "/home/adam/Desktop/WriteUpApp/dist/${PKG_DIR}/usr/local/bin/${APP_NAME}"
# Control file
cat > "/home/adam/Desktop/WriteUpApp/dist/${PKG_DIR}/DEBIAN/control" <<EOF
Package: ${APP_NAME}
Version: ${VERSION}
Section: utils
Priority: optional
Architecture: amd64
Maintainer: Petho Adam <petho.adam@hotmail.com>
Description: Write unchangeable message onto the Blockchain.
A small desktop app for creating PSBTs with custom OP_RETURN outputs.
EOF
# Copy published files
cp -r "/home/adam/Desktop/WriteUpApp/dist/${RUNTIME}" "/home/adam/Desktop/WriteUpApp/dist/${PKG_DIR}/usr/local/bin/${APP_NAME}"
# Build the .deb
dpkg-deb --build "/home/adam/Desktop/WriteUpApp/dist/${PKG_DIR}" "/home/adam/Desktop/WriteUpApp/dist/${APP_NAME}-${VERSION}.deb"
echo "=== Packages created ==="