simp-test 0.2.3 → 0.3.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tag_deploy_rubygem.yml +39 -9
- data/lib/simp/test/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92dd023dfe9c8794387dfb5d49f29472eceded97ecb8125e51f9abeb0f0066cb
|
4
|
+
data.tar.gz: c804fecca73ed42aa639041103eb0e9bc1815bb218a86a808392f1497c83920a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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='
|
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
|
-
|
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
|
-
[ -
|
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:
|
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
|
data/lib/simp/test/version.rb
CHANGED