Skip to content

Commit 344ad4f

Browse files
committed
Fixing new release workflow
1 parent 76c5e1a commit 344ad4f

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,35 @@ on:
1515
type: string
1616
default: ''
1717
required: true
18+
secrets:
19+
RELEASE_TOKEN:
20+
required: true
1821

1922
jobs:
2023
release:
2124
name: Release
2225
runs-on: ubuntu-latest
26+
defaults:
27+
run:
28+
working-directory: client-python
2329
steps:
2430
- name: checkout repo content
2531
uses: actions/checkout@v4
32+
with:
33+
repository: OpenBAS-Platform/client-python
34+
ref: ${{ inputs.branch_client_python }}
35+
path: client-python
2636
- name: setup python
2737
uses: actions/setup-python@v5
2838
with:
29-
python-version: 3.8 #install the python needed
39+
python-version: 3.11
3040
- name: Install dependencies
3141
run: |
42+
git config --global url."https://x-access-token:${GH_TOKEN}@github.com".insteadOf https://github.com
3243
python -m pip install --upgrade pip
3344
if [ -f scripts/requirements.txt ]; then pip install -r scripts/requirements.txt; fi
45+
env:
46+
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
3447
- name: execute py script # run file
3548
run: |
36-
python scripts/release.py ${{ github.event.inputs.branch_client_python }} ${{ github.event.inputs.previous_version }} ${{ github.event.inputs.new_version }} ${{ github.token }}
49+
python scripts/release.py ${{ inputs.branch_client_python }} ${{ inputs.previous_version }} ${{ inputs.new_version }} ${{ secrets.RELEASE_TOKEN }}

scripts/release.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"github_token", help="The github token to use for the release note.", type=str
2222
)
2323
parser.add_argument(
24-
"--dev", help="Flag to prevent pushing the release.", action="store_false"
24+
"--dev", help="Flag to prevent pushing the release.", action="store_true"
2525
)
2626
args = parser.parse_args()
2727

@@ -51,9 +51,9 @@
5151

5252
# Commit the change
5353
logging.info("[client-python] Pushing to " + branch_client_python)
54-
os.system('git commit -a -m "[client] Release ' + new_version + '" > /dev/null 2>&1')
54+
os.system('git commit -a -m "[client] Release ' + new_version + '"')
5555
if not args.dev:
56-
os.system("git push origin " + branch_client_python + " > /dev/null 2>&1")
56+
os.system("git push origin " + branch_client_python)
5757

5858
logging.info("[client-python] Tagging")
5959
os.system("git tag -f " + new_version)

0 commit comments

Comments
 (0)