You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version v2
- Change: Don't pass the gem host around as an environment variable, extract from the gemspec.
- Change: Don't pass gem keys around in environment variables anymore. Use the installed creds by key name.
- Add: input key to set the key name in gem credentials to use.
- Change: Release/pre-release inputs collapsed into single pre-release input. Push is either release or pre-release version, can't do both (or none!) in the same call anymore.
- Add: Add linter for action code.
- Change: tag-release input renamed to just tag.
- Change: Use command line args instead of env variables for the internal command.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,19 @@
1
1
# CHANGELOG
2
2
3
+
TODO: v2 changes
4
+
3
5
## [Unreleased]
6
+
7
+
## [2.0.0] - 2021-04-26
8
+
9
+
- Change: Don't pass the gem host around as an environment variable, extract from the gemspec.
10
+
- Change: Don't pass gem keys around in environment variables anymore. Use the installed creds by key name.
11
+
- Add: input `key` to set the key name in gem credentials to use.
12
+
- Change: Release/pre-release inputs collapsed into single pre-release input. Push is either release or pre-release version, can't do both (or none!) in the same call anymore.
13
+
- Add: Add linter for action code.
14
+
- Change: `tag-release` input renamed to just `tag`.
15
+
- Change: Use command line args instead of env variables for the internal command.
16
+
4
17
## [1.3.0] - 2021-04-16
5
18
6
19
- Fix: clean shell log handling for `gem push` call
Copy file name to clipboardExpand all lines: README.md
+31-51Lines changed: 31 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,11 @@
2
2
3
3
## Description
4
4
5
-
Action to push gems to a gem cutter compatible repository. Probably RubyGems or GitHub Packages. It expects the authentication to have already been setup, using the environment variables GEM_HOST and GEM_HOST_API_KEY. See [fac/ruby-gem-setup-github-packages-action](https://github.com/fac/ruby-gem-setup-github-packages-action) for an action to set this up for you to push to GitHub.
5
+
Action to push gems to a gem cutter compatible repository. Basically RubyGems or GitHub Packages. It expects the authentication to have already been setup, `~/.gem/credentials` contains a token for the repo and you know the name of the key.
6
+
See [fac/ruby-gem-setup-github-packages-action](https://github.com/fac/ruby-gem-setup-github-packages-action) for an action to set this up for you. It is actually pretty easy if pushing to the same repo.
6
7
7
8
If the gem version already exists in the repo the action will no-op and still set a success status. This makes it easier to integrate into workflows, safe to re-run (intentionally or accidentally) and wont push duplicate/replacement packages.
9
+
It will still raise an error visible in the summary, letting you know the version already exists.
8
10
9
11
## Usage
10
12
@@ -16,38 +18,28 @@ Build and push all new version of the gem:
Note that the ruby-gem-push-action will push to the host given in the gemspec. The token needs to match. Trying to push to a different host will fail.
47
37
48
38
### Separate release and pre-release workflow
49
39
50
-
You probably don't want to push all versions from any branch. More likely you would want to push release versions from your default branch (e.g. main) and pre-release from PR builds. To help with this the release and pre-release inputs can be used:
40
+
By default, the action only acts on non-pre-release versions, and prints a message if it thinks the gem has a pre-release version number. If you set the input option `pre-release: true`, then it will only act on pre-release versions, and will skip over regular versions. That way, you can have 2 calls to the action, using the workflow to decide the logic.
41
+
42
+
Say you want to push release versions from your default branch (main) and pre-release versions from PR builds:
# Release production gem version from default branch
88
-
- name: Push Release Gem
78
+
- name: Release Gem
89
79
if: github.ref == 'refs/heads/main'
90
-
uses: fac/ruby-gem-push-action@v1
80
+
uses: fac/ruby-gem-push-action@v2
81
+
with:
82
+
key: github
91
83
92
84
# PR branch builds will release pre-release gems
93
-
- name: Push Pre-Release Gem
85
+
- name: Pre-Release Gem
94
86
if: github.ref != 'refs/heads/main'
95
-
uses: fac/ruby-gem-push-action@v1
87
+
uses: fac/ruby-gem-push-action@v2
96
88
with:
97
-
release: false
89
+
key: github
98
90
pre-release: true
99
91
```
100
92
@@ -103,31 +95,26 @@ The release job runs if the tests pass, we always package the gem to test that w
103
95
104
96
## Inputs
105
97
106
-
### package-glob
98
+
### gem-glob
107
99
108
100
File glob to match the gem file to push. The default `pkg/*.gem` picks up gems built using `bundle exec rake build`. You may need to set this if your your gem builds another way.
109
101
110
102
```yaml
111
103
- name: Push Gem
112
104
uses: fac/ruby-gem-push-action@v1
113
105
with:
114
-
package-glob: build/special.gem
106
+
gem-glob: build/special.gem
115
107
```
116
-
117
-
### release
118
-
119
-
Whether to push new release versions of the gem. Defaults to true.
120
-
121
108
### pre-release
122
109
123
-
Whether to push new pre-release versions of the gem. Defaults to true.
110
+
Whether to push new pre-release versions of the gem and ignore releases, instead of the normal, push prod releases but ignore pre-release.
124
111
125
-
### tag-release
112
+
### tag
126
113
127
114
When true (the default), after pushing a new gem version tag the repo with
128
115
the version number prefixed with `v`. e.g. after pushing version `0.1.0`, the
129
-
tag will be `v0.1.0`. This is the same behavior as `gem tag`, but internally
130
-
implemented to work with older gem versions.
116
+
tag will be `v0.1.0`. This is the same behavior as `gem tag`. (Internally
117
+
implemented to work with older gem versions and around bugs that caused tags for failed pushes, which then blocked re-pushing.
131
118
132
119
The tag commit and push will be made as the author of the commit being tagged.
133
120
@@ -139,14 +126,7 @@ If we pushed a gem to the repository, this will be set to the version pushed.
139
126
140
127
## Environment Variables
141
128
142
-
### GEM_HOST_API_KEY
143
-
144
-
Read to get the API key string (prefixed token with Bearer), to access the package repo. Used by `gem push`.
0 commit comments