|
1 |
| -name: Version Bump and Release |
2 |
| - |
| 1 | +name: release |
3 | 2 | on:
|
4 | 3 | push:
|
5 | 4 | branches:
|
6 | 5 | - main
|
7 |
| - workflow_dispatch: |
8 | 6 |
|
9 | 7 | jobs:
|
10 |
| - bump-version: |
| 8 | + release-please: |
11 | 9 | runs-on: ubuntu-latest
|
12 | 10 | steps:
|
13 |
| - - name: Checkout repository |
14 |
| - uses: actions/checkout@v3 |
15 |
| - |
16 |
| - - name: Set up Node.js |
17 |
| - uses: actions/setup-node@v3 |
| 11 | + - uses: GoogleCloudPlatform/release-please-action@v2 |
18 | 12 | with:
|
19 |
| - node-version: '18' |
20 |
| - |
21 |
| - - name: Install dependencies |
22 |
| - run: yarn install |
23 |
| - |
24 |
| - - name: Bump version |
25 |
| - run: | |
26 |
| - yarn version --patch --no-commit-hooks --no-git-tag-version |
27 |
| -
|
28 |
| - - name: Get new version |
29 |
| - id: new_version |
30 |
| - run: | |
31 |
| - NEW_VERSION=$(node -p -e "require('./package.json').version") |
32 |
| - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV |
33 |
| -
|
34 |
| - - name: Commit and push changes |
35 |
| - run: | |
36 |
| - git config user.name "github-actions[bot]" |
37 |
| - git config user.email "github-actions[bot]@users.noreply.github.com" |
38 |
| - git add package.json yarn.lock |
39 |
| - git commit -m "Bump version to ${{ env.NEW_VERSION }} [skip ci]" |
40 |
| - git tag "v${{ env.NEW_VERSION }}" |
41 |
| - git push --follow-tags |
42 |
| -
|
43 |
| - - name: Create a pull request for the new version |
44 |
| - uses: peter-evans/create-pull-request@v5 |
45 |
| - with: |
46 |
| - branch: bump-version |
47 |
| - commit-message: "Bump version to ${{ env.NEW_VERSION }}" |
48 |
| - title: "Bump version to ${{ env.NEW_VERSION }}" |
49 |
| - body: "This PR bumps the package version to ${{ env.NEW_VERSION }}." |
50 |
| - labels: version-bump |
51 |
| - |
52 |
| - notify-users: |
53 |
| - needs: bump-version |
54 |
| - runs-on: ubuntu-latest |
55 |
| - steps: |
56 |
| - - name: Send notification to users |
57 |
| - run: | |
58 |
| - echo "Sending notification to users about the new version..." |
59 |
| - # Customize this step to send notifications through email, Slack, or other channels. |
| 13 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 14 | + release-type: node |
| 15 | + package-name: release-please-action |
0 commit comments