Skip to content

Commit fd0d780

Browse files
ci: add publishing of community libraries
* Remove tag creation for all libraries
1 parent daf5d0a commit fd0d780

9 files changed

+235
-28
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI - garf-bid-manager
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'libs/community/google/bid-manager/**'
9+
- '!libs/community/google/bid-manager/*.md'
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
permissions:
17+
id-token: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v4
25+
26+
- name: Get versions and check for change
27+
id: version_check
28+
run: |
29+
PREV_VERSION=$(git show HEAD~1:libs/community/google/bid-manager/garf_bid_manager/__init__.py | grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
30+
CURRENT_VERSION=$(grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" libs/community/google/bid-manager/garf_bid_manager/__init__.py | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
31+
32+
if [[ "$CURRENT_VERSION" != "$PREV_VERSION" ]]; then
33+
echo "Version change detected: $PREV_VERSION -> $CURRENT_VERSION"
34+
echo "should_publish=true" >> $GITHUB_OUTPUT
35+
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
else
37+
echo "No version change. Skipping publish."
38+
echo "should_publish=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Build the package
42+
if: steps.version_check.outputs.should_publish == 'true'
43+
run: uv build libs/community/google/bid-manager/
44+
45+
- name: Publish to PyPI
46+
if: steps.version_check.outputs.should_publish == 'true'
47+
run: uv publish libs/community/google/bid-manager/dist/*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI - garf-google-analytics
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'libs/community/google/google-analytics/**'
9+
- '!libs/community/google/google-analytics/*.md'
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
permissions:
17+
id-token: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v4
25+
26+
- name: Get versions and check for change
27+
id: version_check
28+
run: |
29+
PREV_VERSION=$(git show HEAD~1:libs/community/google/google-analytics/garf_google_analytics/__init__.py | grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
30+
CURRENT_VERSION=$(grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" libs/community/google/google-analytics/garf_google_analytics/__init__.py | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
31+
32+
if [[ "$CURRENT_VERSION" != "$PREV_VERSION" ]]; then
33+
echo "Version change detected: $PREV_VERSION -> $CURRENT_VERSION"
34+
echo "should_publish=true" >> $GITHUB_OUTPUT
35+
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
else
37+
echo "No version change. Skipping publish."
38+
echo "should_publish=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Build the package
42+
if: steps.version_check.outputs.should_publish == 'true'
43+
run: uv build libs/community/google/google-analytics/
44+
45+
- name: Publish to PyPI
46+
if: steps.version_check.outputs.should_publish == 'true'
47+
run: uv publish libs/community/google/google-analytics/dist/*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI - garf-knowledge-graph
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'libs/community/google/knowledge-graph/**'
9+
- '!libs/community/google/knowledge-graph/*.md'
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
permissions:
17+
id-token: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v4
25+
26+
- name: Get versions and check for change
27+
id: version_check
28+
run: |
29+
PREV_VERSION=$(git show HEAD~1:libs/community/google/knowledge-graph/garf_knowledge_graph_api/__init__.py | grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
30+
CURRENT_VERSION=$(grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" libs/community/google/knowledge-graph/garf_knowledge_graph_api/__init__.py | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
31+
32+
if [[ "$CURRENT_VERSION" != "$PREV_VERSION" ]]; then
33+
echo "Version change detected: $PREV_VERSION -> $CURRENT_VERSION"
34+
echo "should_publish=true" >> $GITHUB_OUTPUT
35+
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
else
37+
echo "No version change. Skipping publish."
38+
echo "should_publish=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Build the package
42+
if: steps.version_check.outputs.should_publish == 'true'
43+
run: uv build libs/community/google/knowledge-graph/
44+
45+
- name: Publish to PyPI
46+
if: steps.version_check.outputs.should_publish == 'true'
47+
run: uv publish libs/community/google/knowledge-graph/dist/*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI - garf-merchant-center
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'libs/community/google/merchant/**'
9+
- '!libs/community/google/merchant/*.md'
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
permissions:
17+
id-token: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v4
25+
26+
- name: Get versions and check for change
27+
id: version_check
28+
run: |
29+
PREV_VERSION=$(git show HEAD~1:libs/community/google/merchant/garf_merchant_api/__init__.py | grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
30+
CURRENT_VERSION=$(grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" libs/community/google/merchant/garf_merchant_api/__init__.py | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
31+
32+
if [[ "$CURRENT_VERSION" != "$PREV_VERSION" ]]; then
33+
echo "Version change detected: $PREV_VERSION -> $CURRENT_VERSION"
34+
echo "should_publish=true" >> $GITHUB_OUTPUT
35+
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
else
37+
echo "No version change. Skipping publish."
38+
echo "should_publish=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Build the package
42+
if: steps.version_check.outputs.should_publish == 'true'
43+
run: uv build libs/community/google/merchant/
44+
45+
- name: Publish to PyPI
46+
if: steps.version_check.outputs.should_publish == 'true'
47+
run: uv publish libs/community/google/merchant/dist/*
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI - garf-youtube-reporting-api
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'libs/community/google/youtube/youtube-reporting-api/**'
9+
- '!libs/community/google/youtube/youtube-reporting-api/*.md'
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: pypi
16+
permissions:
17+
id-token: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v4
25+
26+
- name: Get versions and check for change
27+
id: version_check
28+
run: |
29+
PREV_VERSION=$(git show HEAD~1:libs/community/google/youtube/youtube-reporting-api/garf_youtube_reporting_api/__init__.py | grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
30+
CURRENT_VERSION=$(grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" libs/community/google/youtube/youtube-reporting-api/garf_youtube_reporting_api/__init__.py | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
31+
32+
if [[ "$CURRENT_VERSION" != "$PREV_VERSION" ]]; then
33+
echo "Version change detected: $PREV_VERSION -> $CURRENT_VERSION"
34+
echo "should_publish=true" >> $GITHUB_OUTPUT
35+
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
36+
else
37+
echo "No version change. Skipping publish."
38+
echo "should_publish=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Build the package
42+
if: steps.version_check.outputs.should_publish == 'true'
43+
run: uv build libs/community/google/youtube/youtube-reporting-api/
44+
45+
- name: Publish to PyPI
46+
if: steps.version_check.outputs.should_publish == 'true'
47+
run: uv publish libs/community/google/youtube/youtube-reporting-api/dist/*

.github/workflows/publish_pypi_core.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,3 @@ jobs:
4545
- name: Publish to PyPI
4646
if: steps.version_check.outputs.should_publish == 'true'
4747
run: uv publish libs/core/dist/*
48-
- name: Create Git Tag
49-
if: steps.version_check.outputs.should_publish == 'true'
50-
run: |
51-
git config --local user.email "action@github.com"
52-
git config --local user.name "GitHub Action"
53-
git tag v${{ steps.version_check.outputs.new_version }}-core
54-
git push origin v${{ steps.version_check.outputs.new_version }}-core

.github/workflows/publish_pypi_executors.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,3 @@ jobs:
4545
- name: Publish to PyPI
4646
if: steps.version_check.outputs.should_publish == 'true'
4747
run: uv publish libs/executors/dist/*
48-
- name: Create Git Tag
49-
if: steps.version_check.outputs.should_publish == 'true'
50-
run: |
51-
git config --local user.email "action@github.com"
52-
git config --local user.name "GitHub Action"
53-
git tag v${{ steps.version_check.outputs.new_version }}-executors
54-
git push origin v${{ steps.version_check.outputs.new_version }}-executors

.github/workflows/publish_pypi_garf_youtube_data_api.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,3 @@ jobs:
4545
- name: Publish to PyPI
4646
if: steps.version_check.outputs.should_publish == 'true'
4747
run: uv publish libs/community/google/youtube/youtube-data-api/dist/*
48-
- name: Create Git Tag
49-
if: steps.version_check.outputs.should_publish == 'true'
50-
run: |
51-
git config --local user.email "action@github.com"
52-
git config --local user.name "GitHub Action"
53-
git tag v${{ steps.version_check.outputs.new_version }}-yt-data-api
54-
git push origin v${{ steps.version_check.outputs.new_version }}-yt-data-api

.github/workflows/publish_pypi_io.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,3 @@ jobs:
4545
- name: Publish to PyPI
4646
if: steps.version_check.outputs.should_publish == 'true'
4747
run: uv publish libs/io/dist/*
48-
- name: Create Git Tag
49-
if: steps.version_check.outputs.should_publish == 'true'
50-
run: |
51-
git config --local user.email "action@github.com"
52-
git config --local user.name "GitHub Action"
53-
git tag v${{ steps.version_check.outputs.new_version }}-io
54-
git push origin v${{ steps.version_check.outputs.new_version }}-io

0 commit comments

Comments
 (0)