forked from drageelr/manim-data-structures
-
Notifications
You must be signed in to change notification settings - Fork 39
53 lines (50 loc) · 1.83 KB
/
publish-package.yml
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
name: PYPI
on: workflow_dispatch
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y build-essential python3-dev libcairo2-dev libpango1.0-dev ffmpeg
- name: Install PyPI Package
run: pip install --timeout=1000 manim-data-structures
- name: Fetch PyPI Package Version
id: mds_pypi_ver
run: "echo MDS_PYPI_VER=$(pip show manim-data-structures | grep 'Version: ' | sed 's/^.*: //') >> $GITHUB_ENV"
- name: Uninstall PyPI Package
run: pip uninstall -y manim-data-structures
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.2.2'
- name: Install Repo Package
run: |
poetry install
pip install .
- name: Fetch Repo Package Version
id: mds_repo_ver
run: "echo MDS_REPO_VER=$(pip show manim-data-structures | grep 'Version: ' | sed 's/^.*: //') >> $GITHUB_ENV"
- name: Check Version
run: |
chmod +x .github/workflows/comp_ver.sh
.github/workflows/comp_ver.sh "${{ env.MDS_REPO_VER }}" "${{ env.MDS_PYPI_VER }}"
- name: Build Package
run: poetry build
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ format('dist/manim_data_structures-{0}*', env.MDS_REPO_VER) }}
name: ${{ format('Manim Data Structures v{0}', env.MDS_REPO_VER) }}
tag: ${{ env.MDS_REPO_VER }}
- name: Publish to PYPI
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} --local
poetry publish