Skip to content

Commit

Permalink
v4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarZab committed May 14, 2024
1 parent 4000b0c commit 2ab1555
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Publish to NPM
on:
push:
branches:
- 'v4.*'
tags:
- v4.*
jobs:
build:
runs-on: ubuntu-latest
environment: v4
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '20.13.1'
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@povio/ecs-deploy-cli",
"version": "4.3.0",
"bin": {
"ecs-deploy": "./dist/sh.js"
"ecs-deploy": "dist/sh.js"
},
"scripts": {
"start": "tsx ./src/sh.ts",
Expand All @@ -13,7 +13,8 @@
"build:clean": "rm -rf ./dist",
"build": "yarn build:clean && node ./esbuild.mjs && chmod +x ./dist/sh.js",
"build:check": "yarn tsc --project . --noEmit",
"lint": "eslint --fix"
"lint": "eslint --fix",
"push": "yarn exec ./scripts/publish.sh"
},
"files": [
"dist",
Expand All @@ -29,7 +30,7 @@
"homepage": "https://github.com/povio/ecs-deploy-cli",
"bugs": "https://github.com/povio/ecs-deploy-cli/issues",
"repository": {
"url": "https://github.com/povio/ecs-deploy-cli",
"url": "git+https://github.com/povio/ecs-deploy-cli.git",
"type": "git"
},
"author": "Marko Zabreznik <marko.zabreznik@povio.com>",
Expand Down
21 changes: 21 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

# check if the working directory is clean
if [ -n "$(git status --porcelain)" ]; then
echo "Working directory not clean. Please commit all changes before publishing."
exit 1
fi

# read version from package.json
VERSION=$(node -p -e "require('./package.json').version")

# create a new git tag or error out if the tag already exists
git tag -a v$VERSION -m "v$VERSION"

echo "Publishing version: v$VERSION"

read -p "Press enter to continue"

git push origin v4 "v$VERSION"
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ __metadata:
yargs: "npm:^17.7.2"
zod: "npm:^3.23.8"
bin:
ecs-deploy: ./dist/sh.js
ecs-deploy: dist/sh.js
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 2ab1555

Please sign in to comment.