Skip to content

Commit

Permalink
feature/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
choewy committed Mar 18, 2024
1 parent 33fa595 commit 5333318
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: release

on:
push:
tags: [v*]
tags: ['v*']

jobs:
release:
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: version
on:
push:
branches: [master]
paths: [package.json]
paths: ['package.json']

jobs:
tags:
Expand All @@ -13,19 +13,16 @@ jobs:
with:
fetch-depth: 2

- uses: actions/setup-node@v3
with:
node-version: 20

- id: version
- name: diff package.json version
id: version
run: |
previous=$(git show HEAD^:package.json | grep '"version"' | awk -F '"' '{print $4}')
current=$(git show HEAD:package.json | grep '"version"' | awk -F '"' '{print $4}')
echo "$previous $current"
echo "previous=v$previous" >> $GITHUB_OUTPUT
echo "current=v$current" >> $GITHUB_OUTPUT
- if: steps.version.outputs.previous != steps.version.outputs.current
- name: create tag with package.json version
if: steps.version.outputs.previous != steps.version.outputs.current
run: |
git tag ${{ steps.version.outputs.current }}
git push origin ${{ steps.version.outputs.current }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@choewy/nestjs-redis",
"version": "0.0.2",
"version": "0.0.1",
"description": "NestJS Redis",
"main": "dist/libs/index.js",
"license": "MIT",
Expand Down

0 comments on commit 5333318

Please sign in to comment.