wip: add some workflows for backporting, semver, and publishing

This commit is contained in:
Jonathan Kelley 2024-02-21 16:13:33 -08:00
parent fff70973aa
commit 98ef7c829b
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
3 changed files with 62 additions and 1 deletions

24
.github/workflows/backport.yml vendored Normal file
View file

@ -0,0 +1,24 @@
# Attempt to backport a merged pull request to the latest stable release
#
# If the backported PR is succesfully merged
name: Backport merged pull request
on:
pull_request_target:
types: [closed]
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests
jobs:
backport:
name: Backport pull request
runs-on: ubuntu-latest
# Don't run on closed unmerged pull requests
if: github.event.pull_request.merged
steps:
- uses: actions/checkout@v4
- name: Create backport pull requests
uses: korthout/backport-action@v2

View file

@ -46,7 +46,6 @@ jobs:
# Release as-is
# This assumes the version tracking PR has been merged
# cargo workspaces changed
# # version will automatically commit back to the repo
# # cargo workspaces version -y ${{ github.event.inputs.semver }}

View file

@ -7,3 +7,41 @@
# Whenever a PR is made, we want to comment on it:
# - semver compatibility
# - if it's a fix, it should be backported to the minor update PR
on:
push:
branches:
- master
# Generate the minor bump
jobs:
update_routes:
runs-on: ubuntu-latest
steps:
# Check out the repo, but don't persist credentials, so github uses the GITHUB_TOKEN
- uses: actions/checkout@v2
with:
persist-credentials: false
# Run cargo workspaces version to generate the version bump PR
- run: "date > datetime.txt" # create or update a test.txt file
# And then create the PR
- uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "My pull request title"
body: "My pull request body"
branch: "my-pull-request-base-branch"
path: "lib/"
commit-message: "My commit message for uncommitted changes in lib/ folder"
author: "Lorem J. Ipsum <lorem@example.com>"
labels: label1, label2
assignees: user1, user2
reviewers: user1, user2
team_reviewers: team1, team2
auto-merge: squash
update-pull-request-title-and-body: false
# Generate the major bump