Skip to content

Commit 353a9b5

Browse files
albjoaovlecardozo
andauthored
feat(mlop-2455): add release please workflow (#398)
Co-authored-by: Lucas Cardozo <[email protected]>
1 parent 49c91fa commit 353a9b5

File tree

2 files changed

+25
-33
lines changed

2 files changed

+25
-33
lines changed

.github/workflows/publish.yml

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: "Publish"
22
on:
33
push:
4-
paths:
5-
- 'setup.py'
4+
tags:
5+
- '*'
66

77
jobs:
88
Pipeline:
9-
if: github.ref == 'refs/heads/master'
109
runs-on: ubuntu-latest
1110

1211
steps:
@@ -15,42 +14,12 @@ jobs:
1514
with:
1615
python-version: '3.9'
1716

18-
- uses: actions/setup-java@v4
19-
with:
20-
java-version: '17'
21-
distribution: microsoft
22-
23-
- uses: vemonet/setup-spark@v1
24-
with:
25-
spark-version: '3.5.1'
26-
hadoop-version: '3'
27-
2817
- name: Install dependencies
2918
run: make ci-install
3019

3120
- name: Build package
3221
run: make package
3322

34-
- name: Get version
35-
run: echo "version=$(grep __version__ setup.py | head -1 | cut -d \" -f2 | cut -d \' -f2)" >> $GITHUB_ENV
36-
37-
- name: Get release notes
38-
id: get_release_notes
39-
uses: ffurrer2/extract-release-notes@v1
40-
41-
- name: Create release
42-
uses: actions/create-release@v1
43-
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
with:
46-
tag_name: ${{ env.version }}
47-
release_name: Release ${{ env.version }}
48-
body: ${{ steps.get_release_notes.outputs.release_notes }}
49-
50-
- name: Release already exist
51-
if: ${{ failure() }}
52-
run: echo Release already exist
53-
5423
- name: Publish release to pypi.org
5524
if: ${{ success() }}
5625
env:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
push:
3+
branches:
4+
- staging
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: github-actions-developers-runner
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
default-branch: staging
20+
release-type: python
21+
pull-request-title-pattern: "chore${scope}: ${version}"
22+
config-file: release-please-config.json
23+
manifest-file: .release-please-manifest.json

0 commit comments

Comments
 (0)