Skip to content

Commit 160474a

Browse files
author
yuval-shlomo-dekel
committed
add semantic-release workflow
1 parent cd3cf26 commit 160474a

File tree

4 files changed

+82
-58
lines changed

4 files changed

+82
-58
lines changed

.github/workflows/create-release-and-publish.yml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,59 @@ name: Publish a new release
55

66
on:
77
push:
8-
branches:
8+
branches:
99
- main
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 0
18-
- name: Changelog
19-
uses: scottbrenner/generate-changelog-action@master
20-
- name: Bump version and push tag
21-
uses: jaumann/[email protected]
22-
env:
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
- name: Push changes
25-
uses: ad-m/github-push-action@master
26-
with:
27-
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
tags: true
29-
- name: Create Release
30-
id: create_release
31-
uses: actions/create-release@latest
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
34-
with:
35-
tag_name: v1.0.${{ github.run_number }}
36-
release_name: Release v1.0.${{ github.run_number }}
37-
body: |
38-
${{ steps.Changelog.outputs.changelog }}
39-
draft: false
40-
prerelease: false
41-
- uses: actions/checkout@v2
42-
- name: Set up Python 3.9
43-
uses: actions/setup-python@v2
44-
with:
45-
python-version: 3.9
46-
- name: Install pypa/build
47-
run: >-
48-
python -m
49-
pip install
50-
build
51-
--user
52-
- name: Build a binary wheel and a source tarball
53-
run: >-
54-
python -m
55-
build
56-
--sdist
57-
--wheel
58-
--outdir dist/
59-
.
60-
- name: Publish distribution to PyPI
61-
uses: pypa/gh-action-pypi-publish@master
62-
with:
63-
password: ${{ secrets.PYPI_API_TOKEN }}
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: setup nodejs
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: '16'
23+
24+
- name: release using semantic-release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
27+
GIT_AUTHOR_NAME: secrets.automation.dev
28+
GIT_AUTHOR_EMAIL: [email protected]
29+
GIT_COMMITTER_NAME: secrets.automation.dev
30+
GIT_COMMITTER_EMAIL: [email protected]
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install python
34+
pip install --user bumpversion
35+
npm install @semantic-release/changelog
36+
npm install @semantic-release/exec
37+
npm install @semantic-release/git
38+
npm install @semantic-release/github
39+
npx semantic-release
40+
41+
- uses: actions/checkout@v2
42+
- name: Set up Python 3.9
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: 3.9
46+
- name: Install pypa/build
47+
run: >-
48+
python -m
49+
pip install
50+
build
51+
--user
52+
- name: Build a binary wheel and a source tarball
53+
run: >-
54+
python -m
55+
build
56+
--sdist
57+
--wheel
58+
--outdir dist/
59+
.
60+
- name: Publish distribution to PyPI
61+
uses: pypa/gh-action-pypi-publish@master
62+
with:
63+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/run-tests.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ jobs:
1111
build:
1212

1313
runs-on: ubuntu-latest
14-
14+
strategy:
15+
matrix:
16+
python-version: [3.7, 3.8, 3.9]
1517
steps:
1618
- uses: actions/checkout@v2
17-
- name: Set up Python 3.7
19+
- name: Set up Python ${{ matrix.python-version }}
1820
uses: actions/setup-python@v2
1921
with:
20-
python-version: 3.7
22+
python-version: ${{ matrix.python-version }}
2123
- name: Install dependencies
2224
run: |
2325
python -m pip install --upgrade pip
@@ -34,4 +36,4 @@ jobs:
3436
SERVICE_URL: https://9476d663-dc80-4132-aff6-4585ebbdfb2d.us-south.secrets-manager.appdomain.cloud
3537
DNS_CONFIG_CRN: "crn:v1:staging:public:internet-svcs-ci:global:a/791f5fb10986423e97aa8512f18b7e65:dc08a28a-9181-45db-bf0d-a8733a5796b6::"
3638
CA_CONFIG_PRIVATE_KEY: ${{ secrets.CA_CONFIG_PRIVATE_KEY }}
37-
DNS_CONFIG_API_KEY: ${{ secrets.DNS_CONFIG_API_KEY }}
39+
DNS_CONFIG_API_KEY: ${{ secrets.DNS_CONFIG_API_KEY }}

.releaserc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"debug": true,
3+
"branches": [ "main" ],
4+
"plugins": [
5+
"@semantic-release/commit-analyzer",
6+
"@semantic-release/release-notes-generator",
7+
"@semantic-release/changelog",
8+
[
9+
"@semantic-release/exec",
10+
{
11+
"prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch"
12+
}
13+
],
14+
[
15+
"@semantic-release/git",
16+
{
17+
"message": "chore(release): ${nextRelease.version} release notes\n\n${nextRelease.notes}"
18+
}
19+
],
20+
"@semantic-release/github"
21+
]
22+
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ the [IBM Cloud® Secrets Manager APIs](https://cloud.ibm.com/apidocs/secrets-man
2323
The IBM Cloud Secrets Manager Python SDK allows developers to programmatically interact with the following IBM Cloud
2424
services:
2525

26-
Service name | Imported class name
27-
--- | ---
28-
[Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager) | SecretsManagerV1
26+
| Service name | Imported class name |
27+
|------------------------------------------------------------------|----------------------|
28+
| [Secrets Manager](https://cloud.ibm.com/apidocs/secrets-manager) | SecretsManagerV1 |
2929

3030
## Prerequisites
3131

0 commit comments

Comments
 (0)