-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (55 loc) · 1.61 KB
/
publish.yaml
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
name: publish
on:
push:
branches:
- main
env:
CI: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-publish
cancel-in-progress: true
jobs:
build-n-publish:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install Python Dependencies
run: pip install gradio twine build
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Pnpm
run: npm i pnpm@latest -g
- name: Install Node Dependencies
run: pnpm install
- name: Create Release Pull Request to Update Versions
id: changesets
uses: changesets/action@v1
with:
version: pnpm run ci:version
title: 'chore: update versions'
commit: 'chore: update versions'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build Packages and Publish to PyPI
if: steps.changesets.outputs.hasChangesets != 'true'
id: publish
run: pnpm run ci:publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
- name: Create Tag and Release
if: steps.publish.outputs.published == 'true'
run: pnpm run ci:create-tag-n-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.event.repository.name }}
OWNER: ${{ github.repository_owner }}