jekyll_test_plugin 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5d55139a57d74d686990ded9faf505d308bd5f1df3d9713db952d707013f8c3
4
- data.tar.gz: 2fe0b455e892fa1de1102220ddbc55ecbf0e186fb5f493c68481232affb9f3a0
3
+ metadata.gz: 7a4e120156156aa95c5243f4a57951686163d28f9c2e37e59c8af7ac86925d28
4
+ data.tar.gz: de6e8e324b8e1bb3b7b1de2d9f0283e0fa687bc787b320218362fbfe6e445900
5
5
  SHA512:
6
- metadata.gz: c0a42b76b9d6d9c30ca8809b15001e9d675400aa7a86376179fd29c5e5cb8858822783f58d0c79e727b29203bdd1c8b5de6a2e46c512a9f9c8366735665f06a2
7
- data.tar.gz: 9034c8604e0da3b6348b72cc0b45a30319bf4112471430bba43dc1414c4741be9e53458bc785e3dde20bb6418a370c943f52b2e095c77dc22f86d56058695faa
6
+ metadata.gz: eeb41a2ca05835ae3173b9dc3233cc65b2e81935c89a1f40989046d86735d049618ceab55832d8544cfbf8b9df20694797b52062ed18638523e143be2d22a737
7
+ data.tar.gz: 3f9e61fbf7bc44f48365749ca103aa57aea9dfe583b81d5b98009b17150c16554625e6af78f649b75c2fdfda612dabb7dc8eb0692c1a618136c43a8a4d161c05
@@ -1,14 +1,14 @@
1
- name: Gem Tasks
1
+ name: Release Gem
2
2
 
3
3
  on:
4
4
  push:
5
- tags:
6
- - "v*"
5
+ paths:
6
+ - "lib/**/version.rb"
7
7
 
8
8
  jobs:
9
- gem_build:
10
- if: "github.repository_owner == 'jekyll' && startsWith(github.event.head_commit.message, 'Release :gem:')"
11
- name: "Build Gem (Ruby ${{ matrix.ruby_version }})"
9
+ release:
10
+ if: "github.repository_owner == 'jekyll'"
11
+ name: "Release Gem (Ruby ${{ matrix.ruby_version }})"
12
12
  runs-on: "ubuntu-latest"
13
13
  strategy:
14
14
  fail-fast: true
@@ -25,17 +25,25 @@ jobs:
25
25
  bundler-cache: true
26
26
  - name: Extract Plugin Version
27
27
  id: plugin-meta
28
- run: echo "::set-output name=version::$(bundle exec ruby -e 'require "jekyll_test_plugin"; puts JekyllTestPlugin::VERSION')"
28
+ run: |
29
+ echo "::set-output name=tag_version::$(bundle exec rake project:tag_version)"
30
+ echo "::set-output name=gem_name::$(bundle exec rake project:gem_name)"
29
31
  shell: bash
30
- - name: "Build Gem (JekyllTestPlugin ${{ steps.plugin-meta.outputs.version }})"
31
- run: gem build jekyll_test_plugin.gemspec
32
+ - name: Tag Details
33
+ env:
34
+ EVENT_JSON: ${{ toJSON(github.event) }}
35
+ run: bundle exec ruby .github/workflows/scripts/tag_info.rb
36
+ - name: "Build Gem (${{ steps.plugin-meta.outputs.gem_name }})"
37
+ run: bundle exec rake build
32
38
  - name: Archive gem as artifact
33
39
  uses: actions/upload-artifact@v2
34
40
  with:
35
- name: "jekyll_test_plugin-${{ steps.plugin-meta.outputs.version }}"
36
- path: "jekyll_test_plugin-${{ steps.plugin-meta.outputs.version }}.gem"
41
+ name: "${{ steps.plugin-meta.outputs.gem_name }}"
42
+ path: "pkg/${{ steps.plugin-meta.outputs.gem_name }}.gem"
37
43
  retention-days: 5
38
44
  - name: Release Gem via Rubygems.org
39
45
  env:
40
46
  GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_GEM_PUSH_API_KEY }}
41
- run: "gem push jekyll_test_plugin-${{ steps.plugin-meta.outputs.version }}.gem"
47
+ run: |
48
+ gem push pkg/${{ steps.plugin-meta.outputs.gem_name }}.gem
49
+ git push origin ${{ steps.plugin-meta.outputs.tag_version }}
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "colorator"
4
+ require "json"
5
+
6
+ data = JSON.parse(ENV["EVENT_JSON"])
7
+ label = %Q(TAG #{data["ref"].delete_prefix("refs/tags/").cyan})
8
+ puts <<-TEXT
9
+
10
+ ---------------------------------------------------------
11
+ #{label.center(64)}
12
+ ---------------------------------------------------------
13
+ Pushed by: #{data.dig("pusher", "name")&.cyan}
14
+ Repository: #{data.dig("repository", "full_name")&.cyan}
15
+
16
+ Head Commit Details:
17
+
18
+ #{data.dig("head_commit", "message").inspect.cyan}
19
+
20
+ Author: #{data.dig("head_commit", "author", "username")&.cyan}
21
+ Committer: #{data.dig("head_commit", "committer", "username")&.cyan}
22
+ SHA ID: #{data.dig("head_commit", "id")&.cyan}
23
+ ---------------------------------------------------------
24
+ TEXT
data/Rakefile CHANGED
@@ -1 +1,30 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ namespace :project do
4
+ require "forwardable"
5
+
6
+ module Project
7
+ class Spec
8
+ extend Forwardable
9
+
10
+ def_delegators :@gemspec, :name, :version
11
+
12
+ def initialize(name)
13
+ gemspec_file = "#{name}.gemspec"
14
+ @gemspec = Bundler.load_gemspec(gemspec_file)
15
+ end
16
+ end
17
+ end
18
+
19
+ spec = Project::Spec.new("jekyll_test_plugin")
20
+
21
+ desc "Print basename of built gem."
22
+ task :gem_name do
23
+ puts "#{spec.name}-#{spec.version}"
24
+ end
25
+
26
+ desc "Print lib version prefixed with 'v'."
27
+ task :tag_version do
28
+ puts "v#{spec.version}"
29
+ end
30
+ end
@@ -1,3 +1,3 @@
1
1
  module JekyllTestPlugin
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll_test_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-07 00:00:00.000000000 Z
11
+ date: 2021-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".github/workflows/gem.yml"
63
+ - ".github/workflows/scripts/tag_info.rb"
63
64
  - ".gitignore"
64
65
  - Gemfile
65
66
  - History.markdown