Skip to content

Commit

Permalink
Merge branch 'main' into feature/compose-directive
Browse files Browse the repository at this point in the history
  • Loading branch information
arutkowski00 committed Nov 20, 2024
2 parents e633d4e + 28d221f commit 1268834
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 70 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
if: github.ref == 'refs/heads/main'
env:
BUNDLE_APP_CONFIG: .bundle
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
Expand All @@ -97,3 +99,5 @@ jobs:
with:
cmd: install
- run: npx semantic-release
env:
BUNDLE_FROZEN: false
82 changes: 76 additions & 6 deletions .github/workflows/semantic.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: "Semantic Pull Request"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
pull_request:
branches:
- main

permissions:
pull-requests: write
Expand Down Expand Up @@ -44,3 +41,76 @@ jobs:
with:
header: pr-title-lint-error
delete: true

semantic-versioning:
name: Report semantic changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Check semantic versioning
id: semantic-release
run: |
GITHUB_REF=${{ github.head_ref }}
npx semantic-release --no-ci --dry-run --plugins @semantic-release/commit-analyzer,@semantic-release/release-notes-generator --branches ${{ github.head_ref }} > output.txt
OUTPUT=$(cat output.txt | base64 -w 0)
echo "::set-output name=releaseNote::$OUTPUT"
- name: Report semantic versioning
uses: actions/github-script@v3
if: ${{ steps.semantic-release.outputs.releaseNote != '' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// build release note
const semanticReleaseOutput = Buffer.from('${{ steps.semantic-release.outputs.releaseNote }}', 'base64').toString('utf8');
const semanticReleaseLogMatch = /^[[0-9:\sAMPM]+\]\s\[semantic-release\].*$/;
const lines = semanticReleaseOutput.split('\n');
const lastSemanticReleaseLogIndex = [...lines]
.reverse()
.findIndex((line) => line.match(semanticReleaseLogMatch));
const releaseNoteIndex = lines.length - lastSemanticReleaseLogIndex;
const releaseNote = lines.slice(releaseNoteIndex);
let res = releaseNote.join('\n');
if (!releaseNote.length || !res) {
res = '### No release note would be generated.';
}
const SEMANTIC_RELEASE_BODY_HEADER = '## 📝 Semantic Release Report';
const body = [SEMANTIC_RELEASE_BODY_HEADER, res].join('\n');
// get last comment
const comments = await github.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
});
// find comments to delete
const commentsToDelete = comments.data.filter((comment) =>
comment.body.startsWith(SEMANTIC_RELEASE_BODY_HEADER)
);
// delete comments
const prms = commentsToDelete.map((comment) =>
github.issues.deleteComment({
comment_id: comment.id,
owner: context.repo.owner,
repo: context.repo.repo
})
);
await Promise.all(prms);
// create new comment for release note
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
});
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [3.9.0](https://github.com/mondaycom/apollo-federation-ruby/compare/v3.8.5...v3.9.0) (2024-11-20)


### Features

* add [@policy](https://github.com/policy) and respect federation_version in link ([410ef6c](https://github.com/mondaycom/apollo-federation-ruby/commit/410ef6c99efc5e33b9c0cdd29161fc7451ae3a88))

## [3.8.5](https://github.com/Gusto/apollo-federation-ruby/compare/v3.8.4...v3.8.5) (2024-04-02)


Expand Down
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ source 'https://rubygems.org'

gemspec

# Fixes an issue in ruby 3.2, remove when a new version is published
gem 'appraisal', git: 'https://github.com/thoughtbot/appraisal', ref: 'ea2baff57bc7f9e5f9e7a648916c9ae536325116'
gem 'appraisal', '~> 2.5.0'
gem 'graphql', '~> 2.0.0'
143 changes: 82 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,69 +1,85 @@
GIT
remote: https://github.com/thoughtbot/appraisal
revision: ea2baff57bc7f9e5f9e7a648916c9ae536325116
ref: ea2baff57bc7f9e5f9e7a648916c9ae536325116
specs:
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)

PATH
remote: .
specs:
apollo-federation (3.8.5)
apollo-federation (3.9.0)
google-protobuf (~> 3.22)
graphql (>= 1.10.14)

GEM
remote: https://rubygems.org/
specs:
actionpack (7.0.4.3)
actionview (= 7.0.4.3)
activesupport (= 7.0.4.3)
rack (~> 2.0, >= 2.2.0)
actionpack (7.1.5)
actionview (= 7.1.5)
activesupport (= 7.1.5)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.4.3)
activesupport (= 7.0.4.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actionview (7.1.5)
activesupport (= 7.1.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (7.0.4.3)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activesupport (7.1.5)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
builder (3.2.4)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
builder (3.3.0)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
crass (1.0.6)
diff-lcs (1.5.0)
erubi (1.12.0)
google-protobuf (3.22.2)
graphql (2.0.19)
i18n (1.12.0)
diff-lcs (1.5.1)
drb (2.2.1)
erubi (1.13.0)
google-protobuf (3.25.5)
google-protobuf (3.25.5-arm64-darwin)
google-protobuf (3.25.5-x86_64-darwin)
google-protobuf (3.25.5-x86_64-linux)
graphql (2.0.31)
base64
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.8.1)
json (2.8.2)
language_server-protocol (3.17.0.3)
loofah (2.19.1)
logger (1.6.1)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (1.0.0)
mini_portile2 (2.8.7)
minitest (5.18.0)
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
nokogiri (>= 1.12.0)
method_source (1.1.0)
mini_portile2 (2.8.8)
minitest (5.25.1)
mutex_m (0.3.0)
nokogiri (1.15.6)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.14.2-arm64-darwin)
nokogiri (1.15.6-arm64-darwin)
racc (~> 1.4)
nokogiri (1.14.2-x86_64-darwin)
nokogiri (1.15.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.2-x86_64-linux)
nokogiri (1.15.6-x86_64-linux)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.6.0)
Expand All @@ -76,30 +92,34 @@ GEM
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
racc (1.8.1)
rack (2.2.6.4)
rack (3.1.8)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rainbow (3.1.1)
rake (13.0.6)
rake (13.2.1)
regexp_parser (2.9.2)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.1)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.2)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.4)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.68.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
Expand All @@ -115,11 +135,12 @@ GEM
rubocop-rspec (3.2.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
thor (1.2.1)
securerandom (0.3.2)
thor (1.3.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.6.0)
webrick (1.8.1)
webrick (1.9.0)

PLATFORMS
arm64-darwin-21
Expand All @@ -133,7 +154,7 @@ PLATFORMS
DEPENDENCIES
actionpack
apollo-federation!
appraisal!
appraisal (~> 2.5.0)
graphql (~> 2.0.0)
pry-byebug
rack
Expand Down
2 changes: 1 addition & 1 deletion lib/apollo-federation/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ApolloFederation
VERSION = '3.8.5'
VERSION = '3.9.0'
end

0 comments on commit 1268834

Please sign in to comment.