Skip to content

Commit

Permalink
ci: cron issue creation and manual release
Browse files Browse the repository at this point in the history
  • Loading branch information
tchataigner committed Jun 13, 2024
1 parent 4123628 commit d94b897
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/aptos-light-client-patch-release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Aptos LC - Create Patched Release Branch

on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag patched'
required: true

jobs:
create-branch:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history so we can perform a rebase
ref: "dev"

- name: Create and push branch
uses: peterjgrainger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: 'refs/heads/release/${{ github.event.inputs.tag }}-patched'
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check for new tags and create PR
name: Aptos LC - Check for new tags and create issue

on:
schedule:
Expand All @@ -7,15 +7,20 @@ on:
jobs:
check-tags:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [ 'dev', 'release/aptos-light-client' ]

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history so we can perform a rebase
ref: "dev"

- name: Check branch name
run: |
if [[ "${GITHUB_REF#refs/heads/}" != "dev" ]]; then
echo "Workflow run cancelled because it's not on 'dev' branch."
exit 1
fi
- name: Fetch latest tag
id: latest-tag
Expand All @@ -29,31 +34,9 @@ jobs:
exit 0
fi
- name: Compare and rebase
id: rebase
continue-on-error: true
run: |
CURRENT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout ${{ matrix.branch }}
git checkout -b rebase-branch-${{ matrix.branch }}
if ! git rebase --onto ${{ steps.latest-tag.outputs.tag }} $CURRENT_TAG; then
echo "Rebase conflicts detected on branch ${{ matrix.branch }}. Please resolve them manually."
exit 1
fi
git push origin rebase-branch-${{ matrix.branch }}
- name: Create Issue
if: ${{ failure() && steps.rebase.outcome == 'failure' }}
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: ${{ matrix.branch }}
BRANCH: "dev"
TAG: ${{ steps.latest-tag.outputs.tag }}

- name: Create Pull Request
if: ${{ success() }}
uses: peter-evans/create-pull-request@v3
with:
title: 'Rebase on new tag ${{ steps.latest-tag.outputs.tag }}'
branch: 'rebase-branch-${{ matrix.branch }}'
base: '${{ matrix.branch }}'

0 comments on commit d94b897

Please sign in to comment.