Skip to content

Commit 44efbbd

Browse files
committed
CI/CD: Added workflow to create GH release on merge
1 parent 0c59ac1 commit 44efbbd

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
set_version:
9+
name: Set the version of the release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set version
16+
id: set_version
17+
run: |
18+
echo version=$( sed -e 's/__version__ = "\(.*\)"/\1/g' <<< $(grep -E '__version__ = ' shellhub/__init__.py)) >> "$GITHUB_OUTPUT"
19+
outputs:
20+
version: ${{ steps.set_version.outputs.version }}
21+
22+
gh-release:
23+
name: Create a release in GitHub
24+
needs:
25+
- set_version
26+
runs-on: ubuntu-latest
27+
if: test -z "${{ needs.set_version.outputs.version }}"
28+
steps:
29+
- name: Create Release
30+
id: create_release
31+
uses: softprops/action-gh-release@v1
32+
with:
33+
draft: false
34+
prerelease: false
35+
tag_name: v${{ needs.set_version.outputs.version }}
36+
generate_release_notes: true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,5 @@ jules.lasne@gmail.com
9797

9898
- [ ] Migrate tests to pytest-recording
9999
- [ ] Add a readthedocs documentation
100-
- [ ] Switch to an OpenAPI generated client ? see https://github.com/shellhub-io/shellhub/issues/3497#issuecomment-1917478654
100+
- [ ] Switch to an OpenAPI generated client ? see https://github.com/shellhub-io/shellhub/issues/3497#issuecomment-1917478654
101+
- [ ] Add deployment to pypi on merge to main

0 commit comments

Comments
 (0)