File tree Expand file tree Collapse file tree 3 files changed +42
-4
lines changed Expand file tree Collapse file tree 3 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 1
- workflow "Release a new version" {
1
+ workflow "Release a new production version" {
2
2
on = " release"
3
3
resolves = [" publish-on-orbs-registry" ]
4
4
}
5
5
6
+ workflow "Release a new development version" {
7
+ on = " push"
8
+ resolves = [" publish-on-orbs-registry-dev" ]
9
+ }
10
+
6
11
action "publish-on-orbs-registry" {
7
12
uses = " ./publish-on-orbs-registry/"
8
13
secrets = [" CIRCLECI_TOKEN" ]
9
14
}
15
+
16
+ action "publish-on-orbs-registry-dev" {
17
+ uses = " ./publish-on-orbs-registry/"
18
+ secrets = [" CIRCLECI_TOKEN" ]
19
+ args = " dev"
20
+ }
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ workflows:
37
37
38
38
## Publish on Orbs Registry
39
39
40
+ To publish CircleCI Orbs we use GitHub Actions configured under ` .github `
41
+ folder. Here's how to release an Orb, both for production and development:
42
+
43
+ #### Production Release
44
+
40
45
To publish a new version it's just needed to [ create a new release on this
41
46
repository] ( https://github.com/nebulab/circleci-orbs-feature-branch-preview/releases ) .
42
47
A GitHub action will take care of everything else.
47
52
- ` 1.5.0 ` :thumbsup :
48
53
- ` v1.2 ` :thumbsdown :
49
54
55
+ #### Development Release
56
+
57
+ Everytime you push a commit into master or any other branch, a GitHub Action
58
+ will be triggered to relese a development version of the Orb, scoped by
59
+ branch name.
60
+
61
+ For example if you push a commit into the ` your-username/my-feature ` branch,
62
+ a new development orb will be published as
63
+ ` nebulab/feature-branch-preview@dev:your-username-my-feature ` .
64
+
65
+ ** NOTE:** Development orbs are mutable and expire after 90 days. If someone
66
+ else pushes a new commit on the same branch your development orb will be
67
+ overwritten.
68
+
50
69
## Contributing
51
70
52
71
Bug reports and pull requests are welcome!
Original file line number Diff line number Diff line change 1
1
#! /bin/sh -l
2
2
3
- # $GITHUB_REF is something like "refs/tags/1.6.2" and we need to take
4
- # only the last part of it.
5
- version=${GITHUB_REF/ refs\/ tags\/ / }
3
+ env=$1
4
+
5
+ if [ $env == " dev" ]; then
6
+ # $GITHUB_REF is something like "refs/heads/branch-name"
7
+ git_branch=${GITHUB_REF/ refs\/ heads\/ / }
8
+ version_without_slash=${git_branch// \/ / -}
9
+ version=" dev:${version_without_slash} "
10
+ else
11
+ # $GITHUB_REF is something like "refs/tags/1.6.2"
12
+ version=${GITHUB_REF/ refs\/ tags\/ / }
13
+ fi
6
14
7
15
echo " Trying to publish orb with version ${version} "
8
16
circleci orb publish source.yml " nebulab/feature-branch-preview@${version} " --token $CIRCLECI_TOKEN
You can’t perform that action at this time.
0 commit comments