Skip to content

Commit d88a3ac

Browse files
committed
feat: revert to old release
1 parent 24366b0 commit d88a3ac

File tree

2 files changed

+83
-30
lines changed

2 files changed

+83
-30
lines changed

.github/workflows/python-publish.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@ name: Upload Python Package
66
on:
77
release:
88
types: [published]
9-
paths:
10-
- 'scrapegraph-py/**'
119

1210
jobs:
1311
deploy:
1412

1513
runs-on: ubuntu-latest
16-
# Only run if scrapegraph-py has changes
17-
if: contains(github.event.release.body, 'scrapegraph-py/')
1814

1915
steps:
2016
- uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 83 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,89 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
4-
name: Upload Python Package
5-
1+
name: Release
62
on:
7-
release:
8-
types: [published]
3+
push:
4+
branches:
5+
- main
6+
- pre/*
97

108
jobs:
11-
deploy:
12-
9+
build:
10+
name: Build
1311
runs-on: ubuntu-latest
12+
steps:
13+
- name: Install git
14+
run: |
15+
sudo apt update
16+
sudo apt install -y git
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v3
19+
- name: Install Node Env
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
- name: Checkout
24+
uses: actions/[email protected]
25+
with:
26+
fetch-depth: 0
27+
persist-credentials: false
28+
- name: Build app
29+
run: |
30+
cd scrapegraph-py
31+
uv sync --frozen
32+
uv build
33+
id: build_cache
34+
if: success()
35+
- name: Cache build
36+
uses: actions/cache@v4
37+
with:
38+
path: scrapegraph-py/dist
39+
key: ${{ runner.os }}-build-${{ hashFiles('scrapegraph-py/dist/**') }}
40+
if: steps.build_cache.outputs.id != ''
1441

42+
release:
43+
name: Release
44+
runs-on: ubuntu-latest
45+
needs: build
46+
environment: development
47+
if: |
48+
github.event_name == 'push' && github.ref == 'refs/heads/main' ||
49+
github.event_name == 'push' && github.ref == 'refs/heads/pre/beta' ||
50+
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'main' ||
51+
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'pre/beta'
52+
permissions:
53+
contents: write
54+
issues: write
55+
pull-requests: write
56+
id-token: write
1557
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up Python
18-
uses: actions/setup-python@v5
19-
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: mvincig11
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
git fetch --all --tags
31-
python setup.py sdist bdist_wheel
32-
twine upload dist/*
58+
- name: Checkout repo
59+
uses: actions/[email protected]
60+
with:
61+
fetch-depth: 0
62+
persist-credentials: false
63+
- name: Install uv
64+
uses: astral-sh/setup-uv@v3
65+
- name: Setup Python environment
66+
run: |
67+
cd ./scrapegraph-py
68+
uv sync
69+
- name: Restore build artifacts
70+
uses: actions/cache@v4
71+
with:
72+
path: ./scrapegraph-py/dist
73+
key: ${{ runner.os }}-build-${{ hashFiles('./scrapegraph-py/dist/**') }}
74+
- name: Semantic Release
75+
uses: cycjimmy/[email protected]
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
79+
with:
80+
working_directory: ./scrapegraph-py
81+
semantic_version: 23
82+
extra_plugins: |
83+
semantic-release-pypi@3
84+
@semantic-release/git
85+
@semantic-release/commit-analyzer@12
86+
@semantic-release/release-notes-generator@13
87+
@semantic-release/github@10
88+
@semantic-release/changelog@6
89+
conventional-changelog-conventionalcommits@7

0 commit comments

Comments
 (0)