Skip to content

Add workflow to automatically create new node release #2

Add workflow to automatically create new node release

Add workflow to automatically create new node release #2

Workflow file for this run

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 [email protected]
- 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"
- name: checkout to new version
run: |
git checkout -b ${{ steps.branch-name.outputs.branch_name }}
git add node/Cargo.toml
git commit -m "upgrade node to ${{ steps.new-version.outputs.version }}"
git push --set-upstream origin ${{ steps.branch-name.outputs.branch_name }}
# - name: Create Pull Request
# uses: peter-evans/[email protected]
# 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 }}