Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 5 additions & 4 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
types: [opened, synchronize]
issue_comment:
types: [created]
workflow_call:

jobs:
cla:
Expand All @@ -15,10 +16,10 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
if: |
(github.event.issue.pull_request
&& !github.event.issue.pull_request.merged_at
&& contains(github.event.comment.body, 'signed')
)
github.event_name == 'workflow_dispatch'
|| (github.event.issue.pull_request
&& !github.event.issue.pull_request.merged_at
&& contains(github.event.comment.body, 'signed'))
|| (github.event.pull_request && !github.event.pull_request.merged)
steps:
- uses: Shopify/shopify-cla-action@v1
Expand Down
103 changes: 90 additions & 13 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ jobs:
name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 30
ref: main
fetch-depth: 0
fetch-tags: true
-
name: Set up Ruby
Expand All @@ -91,28 +92,95 @@ jobs:
"${{ needs.read-version.outputs.new_version }}" \
"${{ needs.read-version.outputs.current_version }}"
-
name: Create pull request
env:
GH_TOKEN: ${{ github.token }}
name: Create and push branch
run: |
new_version="${{ needs.read-version.outputs.new_version }}"
branch_name="release/v$new_version"

# Configure git
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

# Create and checkout new branch
git checkout -b "$branch_name"

# Add and commit changes
git add lib/semian/version.rb Gemfile.lock CHANGELOG.md
git commit -m "Bump version to $new_version" -m "Triggered by @${{ github.actor }}"

# Push the branch
git push origin "$branch_name"
-
name: Create signed commit
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
github-token: ${{ github.token }}
script: |
const { execSync } = require('child_process');
const fs = require('fs');
const message = 'Bump version to ${{ needs.read-version.outputs.new_version }}';
const directory = '.';

execSync(`git add ${directory}`);

const gitCmd = `git -c core.quotePath=false status ${directory} --porcelain=v1`;
const status = execSync(gitCmd).toString();
const fileChanges = status
.split('\n')
.filter(line => line)
.map(line => {
const [_, status, path] = line.match(/^(.). (.*)/);

if (status === 'R') {
const [oldPath, newPath] = path.split(' -> ');
return [
{ path: newPath, contents: fs.readFileSync(newPath).toString('base64') },
{ path: oldPath, contents: null }
];
}

return [{
path,
contents: status !== 'D' ? fs.readFileSync(path).toString('base64') : null
}];
})
.flat();

const additions = fileChanges.filter(f => f.contents !== null);
const deletions = fileChanges
.filter(f => f.contents === null)
.map(f => ({ path: f.path }));

console.log('Committing changes:');
additions.forEach(file => console.log(` + ${file.path}`));
deletions.forEach(file => console.log(` - ${file.path}`));

const branch = 'release/v${{ needs.read-version.outputs.new_version }}';
console.log(`Target branch: ${branch}`);

const query = `
mutation CreateCommit($input: CreateCommitOnBranchInput!) {
createCommitOnBranch(input: $input) {
commit {
url
}
}
}
`;

const result = await github.graphql(query, {
input: {
branch: {
repositoryNameWithOwner: `${context.repo.owner}/${context.repo.repo}`,
branchName: branch
},
message: { headline: message },
fileChanges: { additions, deletions },
expectedHeadOid: context.sha
}
});

console.log(`Commit created: ${result.createCommitOnBranch.commit.url}`);
-
name: Create pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
new_version="${{ needs.read-version.outputs.new_version }}"
branch_name="release/v$new_version"

# Create pull request
gh pr create \
--title "Release v$new_version" \
--body "Automated version bump to $new_version
Expand All @@ -129,3 +197,12 @@ jobs:
build the gem and publish it to GitHub releases." \
--base main \
--head "$branch_name"

cla:
name: Run CLA check
needs: [create-pr]
permissions:
actions: write
pull-requests: write
uses: ./.github/workflows/cla.yml
secrets: inherit
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# v0.26.7

* use the correct bot for github actions (#998)
* Redis: Namespace the added OOM error class attr
* Redis: Add OOM configuration leak tests
* Redis: Better command wording 2/2
* Redis: Better command wording 1/2
* Redis: Make OOM Errors configurable for circuit opening
* Redis: Do not open circuit on OOM
* Refresh dependencies for all adapters and fix time helper (#941)
* Bump edge Rails
* Add support for Active Record's PostgreSQL Adapter
* Accept `QueryIntent` from Active Record 8.2 in `execute_intent`
* Modify release workflow to preview changes through a PR (#825)
* Use GitHub assets for RELEASE.md images (#816)
* Create GitHub Action to publish new release (#779)

# v0.26.6

* Remove force_config_validation spammy log
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/semian/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Semian
VERSION = "0.26.6"
VERSION = "0.26.7"
end