diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b81f53..f1d77f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,8 @@ name: Build and test on: [push, pull_request] jobs: - version-bump: + test: + if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" name: Generate build and test runs-on: ubuntu-latest steps: diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index fa30f02..03e306a 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -1,7 +1,10 @@ -name: Update dist - +name: Version bump on: workflow_dispatch: + inputs: + tag_name: + description: 'Version' + required: true jobs: version-bump: name: Update dist @@ -12,4 +15,4 @@ jobs: with: node-version: "12" - run: yarn install - - run: yarn build && yarn run test-dist && git clone https://${{secrets.GH_TOKEN}}@github.com/gautamkrishnar/blog-post-workflow.git publish-repo > /dev/null 2>&1 && cd publish-repo && cp -fv ../dist/blog-post-workflow.js ./dist/blog-post-workflow.js && git config --global user.email "gkr@tuta.io" && git config --global user.name "gkr-bot" && git add ./dist/blog-post-workflow.js && git commit -m "[skip ci] Updated dist" && git push --quiet + - run: yarn build && yarn run test-dist && git clone https://${{secrets.GH_TOKEN}}@github.com/gautamkrishnar/blog-post-workflow.git publish-repo > /dev/null 2>&1 && cd publish-repo && yarn version --new-version ${{ github.event.inputs.tag_name }} --no-git-tag-version && cp -fv ../dist/blog-post-workflow.js ./dist/blog-post-workflow.js && git config --global user.email "gkr@tuta.io" && git config --global user.name "gkr-bot" && git add ./dist/blog-post-workflow.js ./package.json && git commit -m "[skip ci] Published ${{ github.event.inputs.tag_name }}" && git push --quiet