Merge pull request #2 from Thauan/feat/implement-jest-tests #12
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: Increment Version on PR or Commit | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- closed | |
jobs: | |
increment-version: | |
if: | | |
(github.event_name == 'push' && github.event.head_commit.message != 'Merge pull request') || | |
(github.event.pull_request.merged == true) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Build Action | |
run: npm install && npm run build | |
- name: Run Increment Pubspec Version | |
id: increment_version | |
uses: ./ | |
with: | |
enable_on_commit: "true" | |
github_token: "${{ secrets.GITHUB_TOKEN }}" | |
- name: Verify pubspec.yaml | |
run: cat pubspec.yaml | |
- name: Create Tag with New Version | |
if: steps.increment_version.outputs.new_version | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git tag v${{ steps.increment_version.outputs.new_version }} | |
git push origin v${{ steps.increment_version.outputs.new_version }} |