-
Notifications
You must be signed in to change notification settings - Fork 15
89 lines (87 loc) · 2.73 KB
/
release.yml
File metadata and controls
89 lines (87 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release
on:
push:
branches:
- main
- pre/*
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install git
run: |
sudo apt update
sudo apt install -y git
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install Node Env
uses: actions/setup-node@v4
with:
node-version: 20
- name: Checkout
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
persist-credentials: false
- name: Build app
run: |
cd scrapegraph-py
uv sync --frozen
uv build
id: build_cache
if: success()
- name: Cache build
uses: actions/cache@v4
with:
path: scrapegraph-py/dist
key: ${{ runner.os }}-build-${{ hashFiles('scrapegraph-py/dist/**') }}
if: steps.build_cache.outputs.id != ''
release:
name: Release
runs-on: ubuntu-latest
needs: build
environment: development
if: |
github.event_name == 'push' && github.ref == 'refs/heads/main' ||
github.event_name == 'push' && github.ref == 'refs/heads/pre/beta' ||
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'main' ||
github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged && github.event.pull_request.base.ref == 'pre/beta'
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Setup Python environment
run: |
cd ./scrapegraph-py
uv sync
- name: Restore build artifacts
uses: actions/cache@v4
with:
path: ./scrapegraph-py/dist
key: ${{ runner.os }}-build-${{ hashFiles('./scrapegraph-py/dist/**') }}
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
with:
working_directory: ./scrapegraph-py
semantic_version: 23
extra_plugins: |
semantic-release-pypi@3
@semantic-release/git
@semantic-release/commit-analyzer@12
@semantic-release/release-notes-generator@13
@semantic-release/github@10
@semantic-release/changelog@6
conventional-changelog-conventionalcommits@7