Skip to content

Commit 4475cae

Browse files
committed
Added workflow to automate the release process
Signed-off-by: Mike Raineri <michael.raineri@dell.com>
1 parent d42bce7 commit 4475cae

3 files changed

Lines changed: 140 additions & 38 deletions

File tree

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Release and Publish
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Version number'
7+
required: true
8+
changes_1:
9+
description: 'Change entry'
10+
required: true
11+
changes_2:
12+
description: 'Change entry'
13+
required: false
14+
changes_3:
15+
description: 'Change entry'
16+
required: false
17+
changes_4:
18+
description: 'Change entry'
19+
required: false
20+
changes_5:
21+
description: 'Change entry'
22+
required: false
23+
changes_6:
24+
description: 'Change entry'
25+
required: false
26+
changes_7:
27+
description: 'Change entry'
28+
required: false
29+
changes_8:
30+
description: 'Change entry'
31+
required: false
32+
jobs:
33+
release_build:
34+
name: Build the release
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
with:
39+
token: ${{secrets.GITHUB_TOKEN}}
40+
- name: Build the changelog text
41+
run: |
42+
echo 'CHANGES<<EOF' >> $GITHUB_ENV
43+
echo "## [${{github.event.inputs.version}}] - $(date +'%Y-%m-%d')" >> $GITHUB_ENV
44+
echo "- ${{github.event.inputs.changes_1}}" >> $GITHUB_ENV
45+
if [[ -n "${{github.event.inputs.changes_2}}" ]]; then echo "- ${{github.event.inputs.changes_2}}" >> $GITHUB_ENV; fi
46+
if [[ -n "${{github.event.inputs.changes_3}}" ]]; then echo "- ${{github.event.inputs.changes_3}}" >> $GITHUB_ENV; fi
47+
if [[ -n "${{github.event.inputs.changes_4}}" ]]; then echo "- ${{github.event.inputs.changes_4}}" >> $GITHUB_ENV; fi
48+
if [[ -n "${{github.event.inputs.changes_5}}" ]]; then echo "- ${{github.event.inputs.changes_5}}" >> $GITHUB_ENV; fi
49+
if [[ -n "${{github.event.inputs.changes_6}}" ]]; then echo "- ${{github.event.inputs.changes_6}}" >> $GITHUB_ENV; fi
50+
if [[ -n "${{github.event.inputs.changes_7}}" ]]; then echo "- ${{github.event.inputs.changes_7}}" >> $GITHUB_ENV; fi
51+
if [[ -n "${{github.event.inputs.changes_8}}" ]]; then echo "- ${{github.event.inputs.changes_8}}" >> $GITHUB_ENV; fi
52+
echo "" >> $GITHUB_ENV
53+
echo 'EOF' >> $GITHUB_ENV
54+
- name: Update version numbers
55+
run: |
56+
sed -i -E 's/__version__ = .+/__version__ = '\'${{github.event.inputs.version}}\''/' api_emulator/version.py
57+
- name: Update the changelog
58+
run: |
59+
ex CHANGELOG.md <<eof
60+
3 insert
61+
$CHANGES
62+
.
63+
xit
64+
eof
65+
- name: Commit and push the updates
66+
run: |
67+
git config user.name "GitHub Release Workflow"
68+
git config user.email "<>"
69+
git add CHANGELOG.md api_emulator/version.py
70+
git commit -s -m "${{github.event.inputs.version}} versioning"
71+
git push origin master
72+
- name: Make the release
73+
env:
74+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
75+
run: |
76+
gh release create ${{github.event.inputs.version}} -t ${{github.event.inputs.version}} -n "Changes since last release:"$'\n\n'"$CHANGES"

CONTRIBUTING.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Contributing
2+
3+
## Overview
4+
5+
This repository is maintained by the [DMTF](https://www.dmtf.org/ "https://www.dmtf.org/"). All contributions are reviewed and approved by members of the organization.
6+
7+
## Submitting Issues
8+
9+
Bugs, feature requests, and questions are all submitted in the "Issues" section for the project. DMTF members are responsible for triaging and addressing issues.
10+
11+
## Contribution Process
12+
13+
1. Fork the repository.
14+
2. Make and commit changes.
15+
3. Make a pull request.
16+
17+
All contributions must adhere to the BSD 3-Clause License described in the LICENSE.md file, and the [Developer Certificate of Origin](#developer-certificate-of-origin).
18+
19+
Pull requests are reviewed and approved by DMTF members.
20+
21+
## Developer Certificate of Origin
22+
23+
All contributions must adhere to the [Developer Certificate of Origin (DCO)](http://developercertificate.org "http://developercertificate.org").
24+
25+
The DCO is an attestation attached to every contribution made by every developer. In the commit message of the contribution, the developer adds a "Signed-off-by" statement and thereby agrees to the DCO. This can be added by using the `--signoff` parameter with `git commit`.
26+
27+
Full text of the DCO:
28+
29+
```
30+
Developer Certificate of Origin
31+
Version 1.1
32+
33+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
34+
35+
Everyone is permitted to copy and distribute verbatim copies of this
36+
license document, but changing it is not allowed.
37+
38+
39+
Developer's Certificate of Origin 1.1
40+
41+
By making a contribution to this project, I certify that:
42+
43+
(a) The contribution was created in whole or in part by me and I
44+
have the right to submit it under the open source license
45+
indicated in the file; or
46+
47+
(b) The contribution is based upon previous work that, to the best
48+
of my knowledge, is covered under an appropriate open source
49+
license and I have the right under that license to submit that
50+
work with modifications, whether created in whole or in part
51+
by me, under the same open source license (unless I am
52+
permitted to submit under a different license), as indicated
53+
in the file; or
54+
55+
(c) The contribution was provided directly to me by some other
56+
person who certified (a), (b) or (c) and I have not modified
57+
it.
58+
59+
(d) I understand and agree that this project and the contribution
60+
are public and that a record of the contribution (including all
61+
personal information I submit with it, including my sign-off) is
62+
maintained indefinitely and may be redistributed consistent with
63+
this project or the open source license(s) involved.
64+
```

release.sh

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)