simp-test 0.2.3 → 0.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f43822c09fc73ea1003786ae0681c876eadbc54dac9cec5f81faf75ad54e3a91
4
- data.tar.gz: a69ce259dccb6cf1d2ae1e338208697ed11ab6c17182b7e4560b0e0eb08dc66d
3
+ metadata.gz: 92dd023dfe9c8794387dfb5d49f29472eceded97ecb8125e51f9abeb0f0066cb
4
+ data.tar.gz: c804fecca73ed42aa639041103eb0e9bc1815bb218a86a808392f1497c83920a
5
5
  SHA512:
6
- metadata.gz: '02749f2ae69d9f1cb302675d46d0c89dc26c3e0acb9e0cb419097b46c0882e5cda32d89618f4e4bff6d34453b4bb9a494db6942aed8e127ac27f242a7e301ab5'
7
- data.tar.gz: f7b66193010a858369e1f7b57b64052d2a320388d891f4622629caee7c1261797f7b6578f972eb312a4625167624986123119f4829eece7f4f319ff41585baf0
6
+ metadata.gz: 77adaaaac39d83ee85d088f884bd40a419200b87868e9af52d2f0eb62b57ffead3c1854ed55d51187b055e6badf40442c84b06b669987d5d314ec74883d3cb78
7
+ data.tar.gz: da670b1a8374baec9a960aeaff7fd5efb1888933f4e736207cc4cc62e6ff6e36eff4cb5e1a6d2d9477e1784c325ab474cadfad991b953a1af8579b1e07973122
@@ -1,6 +1,6 @@
1
1
  # Build & Deploy RubyGem & GitHub release when a SemVer tag is pushed
2
2
  #
3
- # This workflow's jobs only trigger within the `simp` organization
3
+ # This workflow's jobs are only triggered in repos under the `simp` organization
4
4
  # ------------------------------------------------------------------------------
5
5
  #
6
6
  # NOTICE: **This file is maintained with puppetsync**
@@ -23,6 +23,19 @@
23
23
  #
24
24
  # * The CHANGLOG text is altered to remove RPM-style date headers, which don't
25
25
  # render well as markdown on the GitHub release pages
26
+ #
27
+ # * By default, the gem is built and released using the standard rake tasks
28
+ # from "bundler/gem_tasks". To override these, create a JSON file at
29
+ # `.github/workflows.local.json`, using the format:
30
+ #
31
+ # {
32
+ # "gem_build_command": "bundle exec rake build",
33
+ # "gem_release_command": "bundle exec rake build release:rubygem_push",
34
+ # "gem_pkg_dir": "pkg"
35
+ # }
36
+ #
37
+ # All keys are optional.
38
+ #
26
39
  ---
27
40
  name: 'Tag: Release to GitHub & rubygems.org'
28
41
 
@@ -43,6 +56,7 @@ jobs:
43
56
  outputs:
44
57
  build_command: ${{ steps.commands.outputs.build_command }}
45
58
  release_command: ${{ steps.commands.outputs.release_command }}
59
+ pkg_dir: ${{ steps.commands.outputs.pkg_dir }}
46
60
  steps:
47
61
  - name: "Assert '${{ github.ref }}' is a tag"
48
62
  run: '[[ "$GITHUB_REF" =~ ^refs/tags/ ]] || { echo "::error ::GITHUB_REF is not a tag: ${GITHUB_REF}"; exit 1 ; }'
@@ -56,27 +70,40 @@ jobs:
56
70
  # By default, these are the standard tasks from "bundler/gem_tasks"
57
71
  # To override them in the LOCAL_WORKFLOW_CONFIG_FILE
58
72
  GEM_BUILD_COMMAND='bundle exec rake build'
59
- GEM_RELEASE_COMMAND='gem push pkg/*.gem'
73
+ GEM_RELEASE_COMMAND='bundle exec rake build release:rubygem_push'
74
+ GEM_PKG_DIR='pkg'
75
+ if jq -r '. | keys' "$LOCAL_WORKFLOW_CONFIG_FILE" 2>/dev/null | \
76
+ grep -w '"gem_pkg_dir"' &> /dev/null; then
77
+ GEM_PKG_DIR="$(jq -r .gem_pkg_dir "$LOCAL_WORKFLOW_CONFIG_FILE" )"
78
+ fi
60
79
  if jq -r '. | keys' "$LOCAL_WORKFLOW_CONFIG_FILE" 2>/dev/null | \
61
80
  grep -w '"gem_build_command"' &> /dev/null; then
62
- GEM_BUILD_COMMAND="$(jq .gem_build_command "$LOCAL_WORKFLOW_CONFIG_FILE" )"
81
+ GEM_BUILD_COMMAND="$(jq -r .gem_build_command "$LOCAL_WORKFLOW_CONFIG_FILE" )"
63
82
  fi
64
83
  if jq -r '. | keys' "$LOCAL_WORKFLOW_CONFIG_FILE" 2>/dev/null | \
65
84
  grep -w '"gem_release_command"' &> /dev/null; then
66
- GEM_RELEASE_COMMAND="$(jq .gem_release_command "$LOCAL_WORKFLOW_CONFIG_FILE" )"
85
+ GEM_RELEASE_COMMAND="$(jq -r .gem_release_command "$LOCAL_WORKFLOW_CONFIG_FILE" )"
67
86
  fi
68
87
  echo "::set-output name=build_command::${GEM_BUILD_COMMAND}"
88
+ echo "::set-output name=pkg_dir::${GEM_PKG_DIR}"
69
89
  echo "::set-output name=release_command::${GEM_RELEASE_COMMAND}"
70
90
  - uses: ruby/setup-ruby@v1
71
91
  with:
72
92
  ruby-version: 2.5
73
93
  bundler-cache: true
74
94
  - name: Test build the package
75
- run: "${{ steps.commands.outputs.build_command }}"
95
+ env:
96
+ GEM_BUILD_COMMAND: ${{ steps.commands.outputs.build_command }}
97
+ run: "$GEM_BUILD_COMMAND"
76
98
  - name: "Assert '${{ github.ref }}' matches the package version"
77
99
  run: |
78
100
  tag="${GITHUB_REF/refs\/tags\//}"
79
- [ -f pkg/*-${tag}.gem ] || { echo "::error ::tag '${tag}' does not match package $(ls -1 pkg/*.gem)"; exit 1 ; }
101
+ [ -d "${{ steps.commands.outputs.pkg_dir }}" ] || \
102
+ { echo "::error ::No directory found at ${{ steps.commands.outputs.pkg_dir }}/" ; exit 3 ; }
103
+ ls -1 "${{ steps.commands.outputs.pkg_dir }}"/*.gem || \
104
+ { echo "::error ::No gem file found at ${{ steps.commands.outputs.pkg_dir }}/*.gem" ; exit 2 ; }
105
+ [ -f "${{ steps.commands.outputs.pkg_dir }}"/*-${tag}.gem ] || \
106
+ { echo "::error ::tag '${tag}' does not match package $(ls -1 ${{ steps.commands.outputs.pkg_dir }}/*.gem)"; exit 1 ; }
80
107
 
81
108
  create-github-release:
82
109
  name: Deploy GitHub Release
@@ -142,7 +169,12 @@ jobs:
142
169
  ruby-version: 2.5
143
170
  bundler-cache: true
144
171
  - name: Build RubyGem
145
- run: '$BUILD_COMMAND'
172
+ run: |
173
+ echo "Setting up file permissions..."
174
+ chmod -R go=u-w .
175
+
176
+ echo "Running '$BUILD_COMMAND'..."
177
+ $BUILD_COMMAND
146
178
 
147
179
  - name: Release RubyGem
148
180
  run: |
@@ -155,7 +187,5 @@ jobs:
155
187
  EOF
156
188
  chmod 0600 ~/.gem/credentials
157
189
 
158
- chmod -R go=u-w .
159
-
160
190
  echo "Running '$RELEASE_COMMAND'..."
161
191
  $RELEASE_COMMAND
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Simp
4
4
  module Test
5
- VERSION = '0.2.3'
5
+ VERSION = '0.3.22'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - SIMP Team