Skip to content

Commit 1c7317f

Browse files
committed
updating workflow for debugging
1 parent 782cd72 commit 1c7317f

File tree

1 file changed

+48
-29
lines changed

1 file changed

+48
-29
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
name: Release_Workflow
2+
23
on:
34
push:
45
branches:
56
- master
7+
68
jobs:
79
Code_Analysis_Job:
810
runs-on: ubuntu-latest
911
environment: test
1012
steps:
11-
-
12-
name: Check out repository code
13+
- name: Check out repository code
1314
uses: actions/checkout@v4
14-
-
15-
name: Setup Python environment
15+
16+
- name: Setup Python environment
1617
uses: actions/setup-python@v5
17-
-
18-
name: Install Dependencies
18+
19+
- name: Install Dependencies
1920
run: pip install requests
20-
-
21-
name: Install Package
21+
22+
- name: Install Package
2223
run: pip install -e .
23-
-
24-
name: Running acceptace test
24+
25+
- name: Running acceptance test
2526
run: python test.py
2627
env:
2728
ULTRADNS_UNIT_TEST_USERNAME: ${{ secrets.ULTRADNS_UNIT_TEST_USERNAME }}
@@ -33,41 +34,59 @@ jobs:
3334
needs: Code_Analysis_Job
3435
environment: prod
3536
steps:
36-
-
37-
name: Check out repository code
37+
- name: Check out repository code
3838
uses: actions/checkout@v4
39-
-
40-
name: Setup Python environment
39+
40+
- name: Setup Python environment
4141
uses: actions/setup-python@v5
42-
-
43-
name: Create Release Info
42+
43+
- name: Create Release Info
4444
run: |
4545
PLAIN_VERSION=$(cat .plugin-version | sed 's/^v//')
4646
echo "RELEASE_VERSION=$(cat .plugin-version)" >> $GITHUB_ENV
4747
echo "PLAIN_VERSION=$PLAIN_VERSION" >> $GITHUB_ENV
48-
-
49-
name: Debug Versions
48+
49+
- name: Debug Versions
5050
run: |
5151
echo "Tag version: ${{ env.RELEASE_VERSION }}"
5252
echo "Hatch version: ${{ env.PLAIN_VERSION }}"
53-
-
54-
name: Installing Dependencies
53+
54+
- name: Installing Dependencies
5555
run: |
5656
pip install requests
5757
pip install hatch
58-
-
59-
name: Versioning the build
60-
run: hatch version ${{ env.PLAIN_VERSION }}
61-
-
62-
name: Creating python Package
58+
59+
- name: Ensure Correct Version in about.py
60+
run: |
61+
if grep -q '__version__' src/ultra_rest_client/about.py; then
62+
sed -i 's/^__version__ = .*/__version__ = "'"${{ env.PLAIN_VERSION }}"'"/' src/ultra_rest_client/about.py
63+
else
64+
echo "__version__ = \"${{ env.PLAIN_VERSION }}\"" > src/ultra_rest_client/about.py
65+
fi
66+
cat src/ultra_rest_client/about.py
67+
68+
- name: Check Hatch Version and Update if Necessary
69+
run: |
70+
CURRENT_VERSION=$(hatch version)
71+
echo "Current Hatch version: $CURRENT_VERSION"
72+
echo "PLAIN_VERSION: ${{ env.PLAIN_VERSION }}"
73+
74+
if [ "$CURRENT_VERSION" != "${{ env.PLAIN_VERSION }}" ]; then
75+
echo "Updating version..."
76+
hatch version "${{ env.PLAIN_VERSION }}"
77+
else
78+
echo "Skipping version update. Already set to ${{ env.PLAIN_VERSION }}"
79+
fi
80+
81+
- name: Creating Python Package
6382
run: hatch build
64-
-
65-
name: create release Tag
83+
84+
- name: Create release tag
6685
run: |
6786
git tag ${{ env.RELEASE_VERSION }}
6887
git push origin ${{ env.RELEASE_VERSION }}
69-
-
70-
name: Publishing python Package
88+
89+
- name: Publishing python Package
7190
uses: pypa/[email protected]
7291
with:
7392
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)