Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to automatically create new node release #485

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/node-version-up.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Node Version Up

on:
workflow_dispatch:
inputs:
versioning:
description: "node version up: major, minor, or patch"
ebma marked this conversation as resolved.
Show resolved Hide resolved
required: true
default: "patch"

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 }}
continue-on-error: false
run: |
cargo set-version --bump ${{ github.event.inputs.versioning }} --package pendulum-node
ebma marked this conversation as resolved.
Show resolved Hide resolved
- 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: Create Release Branch for version ${{ steps.new-version.outputs.version }}
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 }}
git push --set-upstream origin release/upgrade-node-to-${{ steps.new-version.outputs.version }}
- name: Commit New Changes to New Branch
run: |
gh api graphql \
-F githubRepository=${{ github.repository }} \
-F branchName=${{ steps.branch-name.outputs.branch_name }} \
-F expectedHeadOid=$(git rev-parse HEAD) \
-F commitMessage="chore: node upgrade to ${{ steps.new-version.outputs.version }}" \
-F files[][path]="node/Cargo.toml" -F files[][contents]=$(base64 -w0 node/Cargo.toml) \
-F '[email protected]/api/createCommitOnBranch.gql'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: ${{ steps.branch-name.outputs.branch_name }}
- name: Create Pull Request
uses: thomaseizinger/create-pull-request@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
title: "release: upgrade node to ${{ steps.new-version.outputs.version }}"
head: ${{ steps.branch-name.outputs.branch_name }}
base: main
reviewers: "ebma, TorstenStueber, bogdanS98, gianfra-t, b-yap"
Loading