-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·41 lines (36 loc) · 1.13 KB
/
increment-pubspec-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Increment Version on PR or Commit
on:
push:
branches:
- main
pull_request:
types:
- closed
jobs:
increment-version:
if: github.event.pull_request.merged == true || github.event_name == 'push'
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 }}