Skip to content

Commit

Permalink
auto create pr at end of benchmarks and release
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Oct 29, 2024
1 parent c8dd0fe commit f578172
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,30 @@ jobs:
exclude-release-only: ${{ github.event.inputs.exclude-release-benchmarks == true }}

create-branch-prefix:
name: Create Branch Prefix
name: Create Branch and Branch Prefix
runs-on: ubuntu-latest
outputs:
branch-prefix: ${{ steps.create-prefix.outputs.branch-prefix }}
base-branch: ${{ steps.create-prefix.outputs.base-branch }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- id: create-prefix
run: |
VERSION=$(jq -r '.version' package.json)
echo "branch-prefix=benchmark--$VERSION-" >> $GITHUB_OUTPUT
echo "base-branch=benchmark--$VERSION" >> $GITHUB_OUTPUT
- uses: ./.github/actions/configure_git
with:
gpg_signing_key: ${{ secrets.GPG_SIGNING_KEY }}

- name: Create base branch
run: |
git checkout -b ${{ steps.create-prefix.outputs.base-branch }}
git push origin ${{ steps.create-prefix.outputs.base-branch }}
run-benchmarks:
name: ${{ matrix.benchmark_group.name }}
Expand Down Expand Up @@ -101,3 +114,21 @@ jobs:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LASTMJS_GITHUB_TOKEN: ${{ secrets.LASTMJS_GITHUB_TOKEN }}

create-pr:
needs: [finalize-benchmark, create-branch-prefix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--base ${{ github.ref_name }} \
--head ${{ needs.create-branch-prefix.outputs.base-branch }} \
--title "Benchmark Results for ${{ needs.create-branch-prefix.outputs.base-branch }}" \
--body "Automated PR for benchmark results"
20 changes: 19 additions & 1 deletion .github/workflows/release_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:

- uses: ./.github/actions/commit_and_push
with:
branch-name: ${{ steps.create-branch-name.outputs.branch-name }}
branch-name: release--${{ needs.prepare-release.outputs.release-version }}
commit-message: 'Update dependencies for ${{ matrix.test.displayPath }}'
gpg_signing_key: ${{ secrets.GPG_SIGNING_KEY }}

Expand Down Expand Up @@ -145,3 +145,21 @@ jobs:
else
gh release create "$VERSION" -t "$VERSION"
fi
create-pr:
needs: [prepare-release, finalize-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}

- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--base ${{ github.ref_name }} \
--head release--${{ needs.prepare-release.outputs.release-version }} \
--title "Release ${{ needs.prepare-release.outputs.release-version }}" \
--body "Automated PR for release ${{ needs.prepare-release.outputs.release-version }}"

0 comments on commit f578172

Please sign in to comment.