-
Notifications
You must be signed in to change notification settings - Fork 14
68 lines (66 loc) · 2.31 KB
/
node-version-up.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Node Version Up
on:
workflow_dispatch:
inputs:
versioning:
description: "node version up: major, minor, or patch"
required: true
default: "patch"
pull_request:
branches:
- main
push:
branches:
- main
jobs:
bump-version:
runs-on: ubuntu-latest
name: bump version
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup user
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: install cargo-edit
run: |
cargo install cargo-edit
# - name: set new version ${{ github.event.inputs.versioning }}
- name: set new version
continue-on-error: false
run: |
cargo set-version --bump patch --package pendulum-node
# cargo set-version --bump ${{ github.event.inputs.versioning }} --package pendulum-node
- name: save updated version
id: new-version
run: |
cd node
echo "version=$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version')" >> "$GITHUB_OUTPUT"
cd ..
- name: save branch name
id: branch-name
run: |
echo "branch_name=release/upgrade-node-to-${{ steps.new-version.outputs.version }}" >> "$GITHUB_OUTPUT"
git checkout -b release/upgrade-node-to-${{ steps.new-version.outputs.version }}
- name: commit new version up
uses: chromeq/commit@v2.x
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
node/Cargo.toml
commit-message: "upgrade node to ${{ steps.new-version.outputs.version }}"
- name: push commit
run: |
git push --set-upstream origin ${{ steps.branch-name.outputs.branch_name }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6.1.0
with:
base: "main"
title: "release: upgrade node to ${{ steps.new-version.outputs.version }}"
branch: "${{ steps.branch-name.outputs.branch_name }}"
body: "View [CHANGES](https://github.com/${{ github.repository }}/compare/main...release/upgrade-node-to-${{ steps.new-version.outputs.version}})"
token: ${{ secrets.GITHUB_TOKEN }}