DVUI pre-release #629
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DVUI pre-release | |
on: | |
workflow_dispatch: {} | |
schedule: | |
# Adjust refresh schedule here. By default, it runs once per day. | |
# Syntax reference: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule | |
# Recommended tool: https://crontab.guru/ | |
- cron: "19 3 * * *" | |
jobs: | |
build-and-publish-npm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.KONFUZIO_PAT }} | |
fetch-depth: 0 # Required to count the commits | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: "https://registry.npmjs.org" | |
- run: npm ci | |
- run: npm run test:unit | |
- name: Git configuration | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Konfuzio Bot" | |
- name: Get new commits | |
# Disable history expansion to avoid issues with the `!` character | |
run: | | |
set +H | |
echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' --perl-regexp --author='^((?!Konfuzio Bot).*)$' | wc -l)" >> $GITHUB_ENV | |
- name: Bump pre-release version | |
if: ${{ env.NEW_COMMIT_COUNT > 0 }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH }} | |
run: | | |
npm version prerelease --preid=dev | |
npm publish --tag prerelease | |
- name: Push changes to repository | |
if: ${{ env.NEW_COMMIT_COUNT > 0 }} | |
run: git push origin |