From c0dfa808ad908fc6f1d1318d98b309824ed0fff4 Mon Sep 17 00:00:00 2001 From: emielvdveen Date: Thu, 15 Feb 2024 14:31:32 +0100 Subject: [PATCH] Improved release script, see issue #14 --- .gitignore | 3 ++- package.json | 5 ++--- release.sh | 8 ++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100755 release.sh diff --git a/.gitignore b/.gitignore index 28d6b8a4..d7127ce7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. -release.zip + # dependencies /node_modules @@ -12,6 +12,7 @@ release.zip # production /build +/releases # misc .DS_Store diff --git a/package.json b/package.json index bea2a883..7bdc6b87 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "port", + "name": "feldspar", "version": "0.1.0", "private": true, "homepage": ".", @@ -31,8 +31,7 @@ "start:app": "react-scripts start", "start": "concurrently 'npm run start:py' 'npm run start:app'", "build": "npm run build:py && npm run build:app && npm run build:css", - "archive": "cd build && zip -r ../release.zip .", - "release": "npm run build && npm run archive", + "release": "npm run build && ./release.sh $npm_package_name", "test": "react-scripts test", "lint": "npm run fix:ts" }, diff --git a/release.sh b/release.sh new file mode 100755 index 00000000..b7a33fa1 --- /dev/null +++ b/release.sh @@ -0,0 +1,8 @@ +#!/bin/bash +NAME=$1 +mkdir -p releases +NR=$(find ./releases -type f | wc -l | xargs) +NR=$(($NR + 1)) +TIMESTAMP=$(date '+%Y-%m-%d') +cd build +zip -r ../releases/${NAME}_${TIMESTAMP}_${NR}.zip . \ No newline at end of file