Skip to content

Commit 3f08170

Browse files
author
Ryan Faircloth
committed
fix: Update CI Standards
1 parent bc69fec commit 3f08170

File tree

9 files changed

+220
-780
lines changed

9 files changed

+220
-780
lines changed

.circleci/config.yml

Lines changed: 14 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -67,84 +67,15 @@ orbs:
6767
- store_test_results:
6868
path: test-results
6969

70-
splunk-release:
71-
executors:
72-
python37:
73-
docker:
74-
- image: circleci/python:3.7
75-
commands:
76-
tag:
77-
parameters:
78-
gh_user:
79-
description: Git Hub username
80-
type: string
81-
gh_token:
82-
description: Git Hub token
83-
type: string
84-
tag_level:
85-
description: Tag level
86-
type: string
87-
steps:
88-
- run:
89-
name: TAG
90-
command: |
91-
git remote set-url origin https://<<parameters.gh_user>>:<<parameters.gh_token>>@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git
92-
./semtag <<parameters.tag_level>>
93-
merge-to-master:
94-
parameters:
95-
gh_user:
96-
description: Git Hub username
97-
type: string
98-
gh_token:
99-
description: Git Hub token
100-
type: string
101-
steps:
102-
- run:
103-
name: Merge
104-
command: |
105-
git remote set-url origin https://<<parameters.gh_user>>:<<parameters.gh_token>>@github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}.git
106-
git config --global user.email "[email protected]"
107-
git config --global user.name "Add on release service"
108-
git pull origin master
109-
git merge master -m "Merge from master"
110-
git checkout master
111-
git merge develop
112-
git push
113-
jobs:
114-
tag:
115-
parameters:
116-
gh_user:
117-
description: Git Hub username
118-
type: string
119-
gh_token:
120-
description: Git Hub token
121-
type: string
122-
tag_level:
123-
description: Tag level
124-
type: string
125-
executor: python37
126-
steps:
127-
- checkout
128-
- tag:
129-
tag_level: <<parameters.tag_level>>
130-
gh_user: <<parameters.gh_user>>
131-
gh_token: <<parameters.gh_token>>
132-
merge-to-master:
133-
executor: python37
134-
parameters:
135-
gh_user:
136-
description: Git Hub username
137-
type: string
138-
gh_token:
139-
description: Git Hub token
140-
type: string
141-
steps:
142-
- checkout
143-
- merge-to-master:
144-
gh_user: <<parameters.gh_user>>
145-
gh_token: <<parameters.gh_token>>
14670

14771
jobs:
72+
release:
73+
docker:
74+
- image: circleci/node:11
75+
steps:
76+
- checkout
77+
- run: npx semantic-release
78+
14879
publish-pypi:
14980
docker:
15081
- image: circleci/python:3.7
@@ -164,7 +95,7 @@ jobs:
16495
source $HOME/.poetry/env
16596
poetry install
16697
poetry run poetry-dynamic-versioning
167-
poetry publish --build -u $TWINE_USERNAME -p $TWINE_PASSWORD
98+
poetry publish --build -u $PYPI_USERNAME -p $PYPI_TOKEN
16899
- save_cache:
169100
key: poetry-cache-{{ checksum "poetry.lock" }}
170101
paths:
@@ -200,89 +131,17 @@ workflows:
200131
filters:
201132
branches:
202133
only: /.*/
203-
- splunk-release/tag:
204-
name: tag-alpha
205-
tag_level: a
206-
gh_user: ${GH_USER}
207-
gh_token: ${GH_PAT}
208-
filters:
209-
branches:
210-
only: develop
211-
- approval-tag-beta:
212-
requires:
213-
- tag-alpha
214-
type: approval
215-
filters:
216-
branches:
217-
only: develop
218-
- splunk-release/tag:
219-
name: tag-beta
220-
tag_level: b
221-
gh_user: ${GH_USER}
222-
gh_token: ${GH_PAT}
223-
requires:
224-
- approval-tag-beta
225-
- approval-merge-beta-to-master:
226-
requires:
227-
- tag-beta
228-
type: approval
229-
filters:
230-
branches:
231-
only: develop
232-
- splunk-release/merge-to-master:
233-
name: merge-beta-to-master
234-
gh_user: ${GH_USER}
235-
gh_token: ${GH_PAT}
236-
requires:
237-
- approval-merge-beta-to-master
238-
filters:
239-
branches:
240-
only: develop
241-
- splunk-release/tag:
242-
name: tag-candidate
243-
tag_level: candidate
244-
gh_user: ${GH_USER}
245-
gh_token: ${GH_PAT}
246-
filters:
247-
branches:
248-
only: master
249-
- approval-tag-final-major:
250-
type: approval
251-
requires:
252-
- tag-candidate
253-
- splunk-release/tag:
254-
name: tag-final-major
255-
tag_level: final -s major
256-
gh_user: ${GH_USER}
257-
gh_token: ${GH_PAT}
258-
requires:
259-
- approval-tag-final-major
260-
- approval-tag-final-minor:
261-
type: approval
262-
requires:
263-
- tag-candidate
264-
- splunk-release/tag:
265-
name: tag-final-minor
266-
tag_level: final -s minor
267-
gh_user: ${GH_USER}
268-
gh_token: ${GH_PAT}
269-
requires:
270-
- approval-tag-final-minor
271-
- approval-tag-final-patch:
272-
type: approval
273-
requires:
274-
- tag-candidate
275-
- splunk-release/tag:
276-
name: tag-final-patch
277-
tag_level: final -s patch
278-
gh_user: ${GH_USER}
279-
gh_token: ${GH_PAT}
134+
- release:
280135
requires:
281-
- approval-tag-final-patch
136+
- test
137+
context:
138+
- gdi-github
282139

283140
publish:
284141
jobs:
285142
- publish-pypi:
143+
context:
144+
- gdi-pypi
286145
filters:
287146
branches:
288147
ignore: /.*/

.github/workflows/cla.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened, closed, synchronize]
7+
8+
jobs:
9+
CLAssistant:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: "CLA Assistant"
13+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
14+
# Alpha Release
15+
uses: cla-assistant/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
# the below token should have repo scope and must be manually added by you in the repository's secret
19+
PERSONAL_ACCESS_TOKEN: ${{ secrets.PAT_CLATOOL }}
20+
with:
21+
path-to-signatures: ".github/signatures/version1/cla.json"
22+
path-to-document: "https://github.com/splunk/addonfactory-test-releaseci/blob/main/CLA.md" # e.g. a CLA or a DCO document
23+
# branch should not be protected
24+
branch: "master"
25+
allowlist: dependabot
26+
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
27+
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
28+
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
29+
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
30+
#signed-commit-messag e: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
31+
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
32+
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
33+
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release-Notes-Preview
2+
3+
on:
4+
pull_request:
5+
# branches: [main, develop]
6+
issue_comment:
7+
types: [edited]
8+
9+
jobs:
10+
preview:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- run: |
15+
git fetch --prune --unshallow --tags
16+
- uses: snyk/[email protected]
17+
with:
18+
releaseBranch: master
19+
env:
20+
GITHUB_PR_USERNAME: ${{ github.actor }}
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Review Secrets
2+
on: [push]
3+
4+
jobs:
5+
review_secrets:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v1
10+
- name: Trufflehog Actions Scan
11+
uses: edplato/[email protected]
12+

.releaserc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
branches:
3+
- "+([0-9])?(.{+([0-9]),x}).x"
4+
- main
5+
- name: develop
6+
channel: beta
7+
prerelease: true
8+
plugins:
9+
- "@semantic-release/commit-analyzer"
10+
- "@semantic-release/release-notes-generator"
11+
- "@semantic-release/github"

CLA.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
By submitting a Contribution to this Work, You agree that Your Contribution is made subject to the primary LICENSE file applicable to this Work. In addition, You represent that: (i) You are the copyright owner of the Contribution or (ii) You have the requisite rights to make the Contribution.
2+
3+
Definitions:
4+
5+
“You” shall mean: (i) yourself if you are making a Contribution on your own behalf; or (ii) your company, if you are making a Contribution on behalf of your company. If you are making a Contribution on behalf of your company, you represent that you have the requisite authority to do so.
6+
7+
"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You for inclusion in, or documentation of, this project/repository. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication submitted for inclusion in this project/repository, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the maintainers of the project/repository.
8+
9+
“Work” shall mean the collective software, content, and documentation in this project/repository.

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Code of conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [[email protected]](mailto:[email protected]). All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

0 commit comments

Comments
 (0)