Skip to content

Commit f9b81cf

Browse files
authored
Merge pull request #24 from github/release-updates
Release Updates
2 parents a380771 + 978a05d commit f9b81cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+179
-92
lines changed

.github/workflows/acceptance.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
has_change: ${{ steps.diff.outputs.has_change}}
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121

2222
- id: fetch-base
2323
if: github.event_name == 'pull_request'
@@ -61,8 +61,9 @@ jobs:
6161
contents: read
6262

6363
steps:
64-
- uses: ruby/setup-ruby@v1
64+
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # [email protected]
6565
with:
66+
bundler-cache: true
6667
ruby-version: ${{ matrix.ruby }}
6768

6869
# If source files were not changed, we don't need the acceptance test suite
@@ -71,9 +72,9 @@ jobs:
7172
run: |
7273
echo "✅ Bypassing acceptance tests - they are not required for this change"
7374
74-
- name: Check out code
75+
- name: checkout
7576
if: ${{ needs.changes.outputs.has_change == 'true' }}
76-
uses: actions/checkout@v2
77+
uses: actions/checkout@v3
7778

7879
# Use Docker layer caching for 'docker build' and 'docker-compose build' commands.
7980
# https://github.com/satackey/action-docker-layer-caching/releases/tag/v0.0.11

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_call:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
name: build
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: checkout
22+
uses: actions/checkout@v3
23+
24+
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # [email protected]
25+
with:
26+
bundler-cache: true
27+
28+
- name: bootstrap
29+
run: script/bootstrap
30+
31+
- name: build
32+
run: |
33+
GEM_NAME=$(ls | grep gemspec | cut -d. -f1)
34+
echo "Attempting to build gem $GEM_NAME..."
35+
gem build $GEM_NAME
36+
if [ $? -eq 0 ]; then
37+
echo "Gem built successfully!"
38+
else
39+
echo "Gem build failed!"
40+
exit 1
41+
fi

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL"
1+
name: CodeQL
22

33
on:
44
push:
@@ -24,8 +24,8 @@ jobs:
2424
language: [ 'ruby' ]
2525

2626
steps:
27-
- name: Checkout repository
28-
uses: actions/checkout@v2
27+
- name: checkout
28+
uses: actions/checkout@v3
2929

3030
# Initializes the CodeQL tools for scanning.
3131
- name: Initialize CodeQL

.github/workflows/lint.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ jobs:
1717
contents: read
1818

1919
steps:
20-
- name: Check out code
21-
uses: actions/checkout@v2
20+
- name: checkout
21+
uses: actions/checkout@v3
2222

23-
- uses: ruby/setup-ruby@v1
23+
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # [email protected]
2424
with:
2525
ruby-version: ${{ matrix.ruby }}
2626
bundler-cache: true
27+
2728
- run: bundle exec rubocop -c .rubocop.yml lib/ spec/

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- lib/version.rb
10+
11+
permissions:
12+
contents: write
13+
packages: write
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: checkout
21+
uses: actions/checkout@v3
22+
23+
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # [email protected]
24+
with:
25+
bundler-cache: true
26+
27+
- name: bootstrap
28+
run: script/bootstrap
29+
30+
- name: lint
31+
run: bundle exec rubocop -c .rubocop.yml lib/ spec/
32+
33+
- name: test
34+
run: script/test
35+
36+
- name: set GEM_NAME from gemspec
37+
run: echo "GEM_NAME=$(ls | grep gemspec | cut -d. -f1)" >> $GITHUB_ENV
38+
39+
# builds the gem and saves the version to GITHUB_ENV
40+
- name: build
41+
run: echo "GEM_VERSION=$(gem build ${{ env.GEM_NAME }}.gemspec 2>&1 | grep Version | cut -d':' -f 2 | tr -d " \t\n\r")" >> $GITHUB_ENV
42+
43+
- name: publish to GitHub packages
44+
run: |
45+
export OWNER=$( echo ${{ github.repository }} | cut -d "/" -f 1 )
46+
GEM_HOST_API_KEY=${{ secrets.GITHUB_TOKEN }} gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} ${{ env.GEM_NAME }}-${{ env.GEM_VERSION }}.gem
47+
48+
- name: release
49+
uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # [email protected]
50+
with:
51+
artifacts: "${{ env.GEM_NAME }}-${{ env.GEM_VERSION }}.gem"
52+
tag: "v${{ env.GEM_VERSION }}"
53+
generateReleaseNotes: true
54+
55+
- name: Publish to RubyGems
56+
run: |
57+
mkdir -p ~/.gem
58+
echo -e "---\n:rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}" > ~/.gem/credentials
59+
chmod 0600 ~/.gem/credentials
60+
gem push ${{ env.GEM_NAME }}-${{ env.GEM_VERSION }}.gem
61+
rm ~/.gem/credentials

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ jobs:
1717
contents: read
1818

1919
steps:
20-
- name: Check out code
21-
uses: actions/checkout@v2
20+
- name: checkout
21+
uses: actions/checkout@v3
2222

23-
- uses: ruby/setup-ruby@v1
23+
- uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # [email protected]
2424
with:
2525
ruby-version: ${{ matrix.ruby }}
2626
bundler-cache: true
27+
2728
- run: script/test -d

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ inherit_gem:
33
- config/default.yml
44

55
AllCops:
6+
SuggestExtensions: false
67
DisplayCopNames: true
78
TargetRubyVersion: 3.1.2
89
Exclude:
910
- 'bin/*'
11+
- 'vendor/**/*'
1012
- 'spec/acceptance/fixtures/**/*'
1113
- 'spec/unit/fixtures/**/*'
1214
- 'vendor/gems/**/*'

Gemfile.lock

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
entitlements-app (0.2.1)
4+
entitlements-app (0.3.0)
55
concurrent-ruby (= 1.1.9)
66
faraday (~> 2.0)
77
net-ldap (~> 0.17)
@@ -11,50 +11,52 @@ PATH
1111
GEM
1212
remote: https://rubygems.org/
1313
specs:
14-
activesupport (7.0.3.1)
14+
activesupport (7.0.7.2)
1515
concurrent-ruby (~> 1.0, >= 1.0.2)
1616
i18n (>= 1.6, < 2)
1717
minitest (>= 5.1)
1818
tzinfo (~> 2.0)
19-
addressable (2.8.1)
19+
addressable (2.8.5)
2020
public_suffix (>= 2.0.2, < 6.0)
2121
ast (2.4.2)
2222
concurrent-ruby (1.1.9)
2323
crack (0.4.5)
2424
rexml
25-
debug (1.6.2)
26-
irb (>= 1.3.6)
25+
debug (1.8.0)
26+
irb (>= 1.5.0)
2727
reline (>= 0.3.1)
2828
diff-lcs (1.5.0)
2929
docile (1.4.0)
30-
faraday (2.7.4)
30+
faraday (2.7.10)
3131
faraday-net_http (>= 2.0, < 3.1)
3232
ruby2_keywords (>= 0.0.4)
3333
faraday-net_http (3.0.2)
3434
hashdiff (1.0.1)
35-
i18n (1.12.0)
35+
i18n (1.14.1)
3636
concurrent-ruby (~> 1.0)
37-
io-console (0.5.11)
38-
irb (1.4.1)
39-
reline (>= 0.3.0)
40-
json (2.6.2)
41-
minitest (5.16.3)
42-
net-ldap (0.17.1)
37+
io-console (0.6.0)
38+
irb (1.7.4)
39+
reline (>= 0.3.6)
40+
json (2.6.3)
41+
minitest (5.19.0)
42+
net-ldap (0.18.0)
4343
octokit (4.25.1)
4444
faraday (>= 1, < 3)
4545
sawyer (~> 0.9)
4646
optimist (3.0.0)
47-
parallel (1.22.1)
48-
parser (3.1.2.1)
47+
parallel (1.23.0)
48+
parser (3.2.2.3)
4949
ast (~> 2.4.1)
50-
public_suffix (5.0.0)
51-
rack (2.2.4)
50+
racc
51+
public_suffix (5.0.3)
52+
racc (1.7.1)
53+
rack (3.0.8)
5254
rainbow (3.1.1)
5355
rake (13.0.6)
54-
regexp_parser (2.5.0)
55-
reline (0.3.1)
56+
regexp_parser (2.8.1)
57+
reline (0.3.8)
5658
io-console (~> 0.5)
57-
rexml (3.2.5)
59+
rexml (3.2.6)
5860
rspec (3.8.0)
5961
rspec-core (~> 3.8.0)
6062
rspec-expectations (~> 3.8.0)
@@ -77,8 +79,8 @@ GEM
7779
rubocop-ast (>= 1.17.0, < 2.0)
7880
ruby-progressbar (~> 1.7)
7981
unicode-display_width (>= 1.4.0, < 3.0)
80-
rubocop-ast (1.21.0)
81-
parser (>= 3.1.1.0)
82+
rubocop-ast (1.29.0)
83+
parser (>= 3.2.1.0)
8284
rubocop-github (0.17.0)
8385
rubocop
8486
rubocop-performance
@@ -90,7 +92,7 @@ GEM
9092
activesupport (>= 4.2.0)
9193
rack (>= 1.1)
9294
rubocop (>= 1.7.0, < 2.0)
93-
ruby-progressbar (1.11.0)
95+
ruby-progressbar (1.13.0)
9496
ruby2_keywords (0.0.5)
9597
rugged (0.27.5)
9698
sawyer (0.9.2)
@@ -103,9 +105,9 @@ GEM
103105
simplecov-erb (1.0.1)
104106
simplecov (< 1.0)
105107
simplecov-html (0.10.2)
106-
tzinfo (2.0.5)
108+
tzinfo (2.0.6)
107109
concurrent-ruby (~> 1.0)
108-
unicode-display_width (2.2.0)
110+
unicode-display_width (2.4.2)
109111
vcr (4.0.0)
110112
webmock (3.4.2)
111113
addressable (>= 2.3.6)

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# entitlements-app
22

3-
[![acceptance](https://github.com/github/entitlements-app/actions/workflows/acceptance.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/acceptance.yml) [![test](https://github.com/github/entitlements-app/actions/workflows/test.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/test.yml) [![lint](https://github.com/github/entitlements-app/actions/workflows/lint.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/lint.yml) [![coverage](https://img.shields.io/badge/coverage-100%25-success)](https://img.shields.io/badge/coverage-100%25-success) [![style](https://img.shields.io/badge/code%20style-rubocop--github-blue)](https://github.com/github/rubocop-github)
3+
[![acceptance](https://github.com/github/entitlements-app/actions/workflows/acceptance.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/acceptance.yml) [![test](https://github.com/github/entitlements-app/actions/workflows/test.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/test.yml) [![lint](https://github.com/github/entitlements-app/actions/workflows/lint.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/lint.yml) [![build](https://github.com/github/entitlements-app/actions/workflows/build.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/build.yml) [![release](https://github.com/github/entitlements-app/actions/workflows/release.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/release.yml) [![codeql](https://github.com/github/entitlements-app/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/github/entitlements-app/actions/workflows/codeql-analysis.yml) [![coverage](https://img.shields.io/badge/coverage-100%25-success)](https://img.shields.io/badge/coverage-100%25-success) [![style](https://img.shields.io/badge/code%20style-rubocop--github-blue)](https://github.com/github/rubocop-github)
44

55
`entitlements-app` is a Ruby gem which provides git-managed LDAP group configuration and access provisioning to your declared resources. It powers Entitlements, GitHub's internal Identity and Access Management (IAM) system. Entitlements is a pluggable system designed to alleviate IAM pain points.
66

77
## Quick Start
88

99
See [getting started](docs/getting-started.md) for quick start, and [entitlements-config](https://github.com/github/entitlements-config) for example configuration.
1010

11-
# Inputs
11+
## Inputs
1212

1313
Entitlements currently supports a single input option of configuration files in the form of `.txt`, `.rb` and `.yaml`.
1414

15-
## Git-managed config
15+
### Git-managed config
1616

1717
Entitlements receives input from configuration files. By using git to back the config files, every file has a complete and visible audit trail.
1818

@@ -48,15 +48,15 @@ For examples on filters, see [filters](docs/filters.md)
4848

4949
There is an example configuration repo [here](https://github.com/github/entitlements-config)
5050

51-
# Outputs
51+
## Outputs
5252

53-
## LDAP
53+
### LDAP
5454

5555
Out of the box, Entitlements will output your sets to LDAP.
5656

5757
See the [OpenLDAP documentation](https://www.openldap.org/doc/) for more on LDAP.
5858

59-
# Plugins
59+
## Plugins
6060

6161
Entitlements is a pluggable system. Plugins can be built for additional inputs and outputs.
6262

@@ -69,3 +69,13 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
6969
## Security
7070

7171
We take security very seriously. Please see [SECURITY](SECURITY.md) for details on how to proceed if you find a security issue.
72+
73+
## Release 🚀
74+
75+
To release a new version of this Gem, do the following:
76+
77+
1. Update the version number in the [`lib/version.rb`](lib/version.rb) file
78+
2. Run `bundle install` to update the `Gemfile.lock` file with the new version
79+
3. Commit your changes, push them to GitHub, and open a PR
80+
81+
Once your PR is approved and the changes are merged, a new release will be created automatically by the [`release.yml`](.github/workflows/release.yml) workflow. The latest version of the Gem will be published to the GitHub Package Registry and RubyGems.

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

entitlements-app.gemspec

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# frozen_string_literal: true
22

3+
require_relative "lib/version"
4+
35
Gem::Specification.new do |s|
4-
s.name = ENV['GEM_NAME'] ? ENV['GEM_NAME'] : 'entitlements-app'
5-
s.version = File.read("VERSION").chomp
6+
s.name = ENV["GEM_NAME"] ? ENV["GEM_NAME"] : "entitlements-app"
7+
s.version = Entitlements::Version::VERSION
68
s.summary = "git-managed LDAP group configurations"
79
s.description = "The Ruby Gem that Powers Entitlements - GitHub's Identity and Access Management System"
810
s.authors = ["GitHub, Inc. Security Ops"]
911
s.email = "[email protected]"
1012
s.license = "MIT"
11-
s.files = Dir.glob("lib/**/*") + %w[bin/deploy-entitlements VERSION]
13+
s.files = Dir.glob("lib/**/*") + %w[bin/deploy-entitlements]
1214
s.homepage = "https://github.com/github/entitlements-app"
1315
s.executables = %w[deploy-entitlements]
1416

lib/version.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
module Entitlements
4+
module Version
5+
VERSION = "0.3.0"
6+
end
7+
end

0 commit comments

Comments
 (0)