Skip to content

Commit

Permalink
self-publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
fergusean committed Oct 14, 2023
1 parent 43a2b28 commit a906d8f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 18.x
Expand All @@ -19,3 +21,25 @@ jobs:
- run: yarn lint
- run: git diff --exit-code
- run: yarn build
- id: detect_version_change
name: Detect version change
if: github.ref == 'refs/heads/develop'
run: |
git fetch --prune --unshallow
LATEST_TAG=$(git describe --tags --abbrev=0)
PREVIOUS_VERSION=$(git show ${LATEST_TAG}:package.json | jq -r '.version')
CURRENT_VERSION=$(cat package.json | jq -r '.version')
if [ "$PREVIOUS_VERSION" != "$CURRENT_VERSION" ]; then
echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION"
echo "VERSION_CHANGED=true" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
else
echo "Version did not change"
fi
- name: Tag version
if: env.VERSION_CHANGED == 'true'
run: |
git config user.name "$(git log -1 --pretty=format:'%an')"
git config user.email "$(git log -1 --pretty=format:'%ae')"
git tag v${PACKAGE_VERSION}
git push origin v${PACKAGE_VERSION}
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.configPath": ".prettierrc.json",
"typescript.tsdk": "node_modules/typescript/lib"
}

0 comments on commit a906d8f

Please sign in to comment.