2021-07-01 19:53:38 +00:00
|
|
|
name: 'Bump Version'
|
2019-10-26 18:01:14 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-08-07 23:35:03 +00:00
|
|
|
- 'bundle-assets'
|
2019-10-26 18:01:14 +00:00
|
|
|
|
2019-08-14 19:19:25 +00:00
|
|
|
jobs:
|
2021-08-07 23:35:03 +00:00
|
|
|
generate-bundle:
|
|
|
|
name: 'Generate bundle'
|
2019-08-14 19:19:25 +00:00
|
|
|
runs-on: ubuntu-latest
|
2019-10-26 18:01:14 +00:00
|
|
|
|
2019-08-14 19:19:25 +00:00
|
|
|
steps:
|
2021-07-01 19:53:38 +00:00
|
|
|
- name: 'Checkout source code'
|
|
|
|
uses: 'actions/checkout@v2'
|
2019-10-26 23:39:43 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.ref }}
|
2021-07-01 19:53:38 +00:00
|
|
|
- name: 'Setup Node.js'
|
|
|
|
uses: 'actions/setup-node@v1'
|
2019-10-26 18:42:21 +00:00
|
|
|
with:
|
2020-04-03 11:04:35 +00:00
|
|
|
node-version: 12
|
2021-08-07 23:35:03 +00:00
|
|
|
- name: 'generate bundle'
|
2021-08-07 21:19:59 +00:00
|
|
|
run: |
|
2021-08-07 23:35:03 +00:00
|
|
|
npm ci
|
|
|
|
npm run build
|
2021-08-07 21:19:59 +00:00
|
|
|
git config user.name "Automated Version Bump"
|
|
|
|
git config user.email "gh-action-bump-version@users.noreply.github.com"
|
2021-08-07 23:35:03 +00:00
|
|
|
git add dist -f
|
2021-08-07 21:19:59 +00:00
|
|
|
if [ $(git status --porcelain=v1 2>/dev/null | wc -l) -gt 0 ]
|
|
|
|
then
|
2021-08-07 23:35:03 +00:00
|
|
|
git commit -m "ci: generate bundle"
|
2021-08-07 21:19:59 +00:00
|
|
|
git push
|
|
|
|
fi
|
|
|
|
|
|
|
|
bump-version:
|
|
|
|
name: 'Bump Version on master'
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-07 23:35:03 +00:00
|
|
|
needs: generate-bundle
|
2021-08-07 21:19:59 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: 'Checkout source code'
|
|
|
|
uses: 'actions/checkout@v2'
|
|
|
|
with:
|
|
|
|
ref: ${{ github.ref }}
|
|
|
|
- name: 'cat package.json'
|
|
|
|
run: cat ./package.json
|
2021-07-01 19:53:38 +00:00
|
|
|
- name: 'Automated Version Bump'
|
2020-11-16 16:24:15 +00:00
|
|
|
id: version-bump
|
2021-08-07 23:35:03 +00:00
|
|
|
uses: 'melody-universe/gh-action-bump-version@bundle-assets'
|
2019-11-20 14:55:55 +00:00
|
|
|
with:
|
2021-05-20 21:13:47 +00:00
|
|
|
tag-prefix: 'v'
|
2019-10-26 18:01:14 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-07-01 19:53:38 +00:00
|
|
|
- name: 'cat package.json'
|
2019-10-27 19:07:29 +00:00
|
|
|
run: cat ./package.json
|
2021-07-01 19:53:38 +00:00
|
|
|
- name: 'Output Step'
|
2020-11-16 16:24:15 +00:00
|
|
|
env:
|
|
|
|
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
|
|
|
|
run: echo "new tag $NEW_TAG"
|