gha_config 0.12 → 0.17

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: 505c781e33f72b50194bcb3537246c35d4ff89d06540cc50d10c75f752e17ddf
4
- data.tar.gz: 1c93a1f335b8f699b943cd64fc3ad0e077522155484254c9aa01b3b398ef0fc9
3
+ metadata.gz: '09d6f4522cd5ee962dab579769563ebe5eb98e41f7183876f8886bc3053a2f9a'
4
+ data.tar.gz: e2dbb45afde2fa01072ca64069a51444107173ee3b4bef3c32e5d1ede11e746c
5
5
  SHA512:
6
- metadata.gz: b95100f624513111e5a8b8e7e1079cdb4f3d27a95e9f91137d8648f729e3ee67ff4db46ff333a0d85ac0403b6eff4ae277eaa358fdd10e991eb7008b0d528fe3
7
- data.tar.gz: 235c656111d2b7df4bbc78e0f927083d96f784bf087a03f0eee9a7b98f6f56e1214dfd787f6de0bd6011be5d2c1b4afbeda47931202add4819d54730ef9f7bdd
6
+ metadata.gz: ca61e7d7ac283a1dfd92ba763460f9ca996076d8f4c6811a38da694b7616242cba4d00930fa9b0415b5f1b2b09184b7a1538ecbbd87763024fdaacfc73cca137
7
+ data.tar.gz: fdcb23e50ef4d9906f75490d2306061671317c37d7e92b6e75e6d1d53f6fbc3d63e24a6f9067fe74d195c3205af0249f23421f83fc6f3ef4075166b19d0d7370
@@ -41,28 +41,3 @@ jobs:
41
41
  run: |
42
42
  sudo chmod 1777 -R /home/circleci/.bundle && bundle config path 'vendor/bundle' && bundle install --jobs=4
43
43
 
44
- deploy-gem:
45
- runs-on: [ubuntu, runner-fleet]
46
- needs: [build]
47
- container:
48
- image: ghcr.io/wishabi/ci-build-environment:ruby-3.0-buster
49
- credentials:
50
- username: ${{ github.repository_owner }}
51
- password: ${{ secrets.GHCR_TOKEN }}
52
- if: github.ref == 'refs/heads/main'
53
- steps:
54
- - name: Checkout code
55
- uses: actions/checkout@v2
56
- - name: Bundle cache
57
- uses: actions/cache@v1
58
- with:
59
- path: vendor/bundle
60
- key: rails-{{ arch }}-{{ checksum "Gemfile.lock" }}
61
- restore-keys: rails-{{ arch }}-
62
- - name: Bundle install
63
- run: |
64
- sudo chmod 1777 -R /home/circleci/.bundle && bundle config path 'vendor/bundle' && bundle install --jobs=4
65
- - name: Deploy to production
66
- run: |
67
- chmod +x ./deploy/artifactory.sh && ./deploy/artifactory.sh
68
-
data/CHANGELOG.md CHANGED
@@ -5,7 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [0.12] - 2021-07-19
8
+ ## [0.17] - 2021-08-04
9
+ - Adds submodules to checkout action
10
+
11
+ ## [0.16] - 2021-07-27
12
+ - Remove dependency on activesupport and byebug
13
+ - Auto-create directory if it doesn't exist
14
+
15
+ ## [0.15] - 2021-07-27
16
+ - Fix bug where defaults are not given (uses [] instead of {})
17
+
18
+ ## [0.14] - 2021-07-22
19
+ - Update global action to v0.4
20
+
21
+ ## [0.13] - 2021-07-19
9
22
  - Fixes related to global action
10
23
 
11
24
  ## [0.11] - 2021-07-15
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gha_config (0.11)
4
+ gha_config (0.15)
5
5
 
6
6
  GEM
7
7
  remote: https://flipplib.jfrog.io/flipplib/api/gems/flipp-gems/
data/README.md CHANGED
@@ -33,7 +33,7 @@ on:
33
33
  - master
34
34
  - develop
35
35
 
36
- defaults_:
36
+ _defaults_:
37
37
  _container_:
38
38
  image: ghcr.io/wishabi/ci-build-environment:ruby-3.0-buster-node
39
39
  credentials:
@@ -131,6 +131,17 @@ Templates get expanded into their contents whenever they are used. Templates can
131
131
 
132
132
  If you're using Ruby, you can add this gem to your app Gemfile. Otherwise, you can install it locally. Either way, you can re-run it whenever your "source workflow" changes.
133
133
 
134
+ ### Notes on checkout Step
135
+ A checkout step is added to every job in the workflow. This looks like below
136
+ ```
137
+ - name: Checkout code
138
+ uses: actions/checkout@v2
139
+ with:
140
+ token: ${{ secrets.FLIPPCIRCLECIPULLER_REPO_TOKEN || github.token }}
141
+ submodules: recursive
142
+ ```
143
+ The submodules are fetched ONLY by adding the `FLIPPCIRCLECIPULLER_REPO_TOKEN` in github repo secrets.
144
+
134
145
  ## Contributing
135
146
 
136
147
  Pull requests are welcome!
data/bin/gha_config CHANGED
@@ -2,7 +2,6 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'yaml'
5
- require 'active_support/all'
6
5
  require 'fileutils'
7
6
 
8
7
  require_relative '../lib/gha_config/parser'
@@ -1,5 +1,3 @@
1
- require 'byebug'
2
-
3
1
  module GhaConfig
4
2
  module Parser
5
3
  def self.parse(input_file)
@@ -7,7 +5,7 @@ module GhaConfig
7
5
  input.gsub!(/(^|\n)on:/, %(\n"on":))
8
6
  hash = YAML.safe_load(input)
9
7
  config = GhaConfig::Config.new
10
- config.defaults = hash.delete('_defaults_') || []
8
+ config.defaults = hash.delete('_defaults_') || {}
11
9
  config.env = hash.delete('env') || {}
12
10
 
13
11
  hash['jobs'] = replace_defaults(config, hash['jobs'])
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GhaConfig
4
- VERSION = '0.12'
4
+ VERSION = '0.17'
5
5
  end
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module GhaConfig
2
4
  module Writer
3
5
  def self.write(config, output_file)
@@ -35,7 +37,7 @@ module GhaConfig
35
37
  job['runs-on'] = '[ubuntu, runner-fleet]'
36
38
  job['steps'].unshift({
37
39
  'name' => 'Flipp global',
38
- 'uses' => 'wishabi/github-actions@v0.3',
40
+ 'uses' => 'wishabi/github-actions@v0.4',
39
41
  'env' => {
40
42
  'SLACK_BOT_TOKEN' => "${{ secrets.SLACK_BOT_TOKEN }}"
41
43
  },
@@ -46,14 +48,24 @@ module GhaConfig
46
48
  }})
47
49
  job['steps'].unshift({
48
50
  'name' => 'Checkout code',
49
- 'uses' => 'actions/checkout@v2'
50
- })
51
+ 'uses' => 'actions/checkout@v2',
52
+ 'with' => {
53
+ 'token' => "${{ secrets.FLIPPCIRCLECIPULLER_REPO_TOKEN || github.token }}",
54
+ 'submodules' => 'recursive'
55
+ }})
51
56
  job['needs'] = "[#{job['needs'].join(', ')}]" if job['needs'].is_a?(Array)
52
57
  new_job.merge!(job)
53
58
  output_hash['jobs'][name] = new_job
54
59
  end
55
60
  output = output_hash.to_yaml
56
61
  output = cleanup(output)
62
+ header = <<-OUT
63
+ ######## GENERATED FROM ./github/workflow-src/CI.yml
64
+ ######## USING gha_config https://github.com/wishabi/gha-config
65
+
66
+ OUT
67
+ output = header + output
68
+ FileUtils.mkdir_p(File.dirname(output_file))
57
69
  File.write(output_file, output)
58
70
  end
59
71
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gha_config
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.12'
4
+ version: '0.17'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -32,7 +32,6 @@ executables:
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - ".github/workflow-src"
36
35
  - ".github/workflows/CI.yml"
37
36
  - ".gitignore"
38
37
  - ".rubocop.yml"
data/.github/workflow-src DELETED
@@ -1,7 +0,0 @@
1
- prod_branch: main
2
- ci_image: ruby-2.6-stretch
3
- mysql: false
4
- kafka: false
5
- datadog: false
6
- redis: false
7
-