-
Notifications
You must be signed in to change notification settings - Fork 311
104 lines (86 loc) · 3 KB
/
publish.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# This workflows will upload a Python Package using twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Build and Release Wheels
on:
release:
types: [created]
permissions:
contents: write
jobs:
# Build the wheels using reusable_building.yml
build_wheels:
name: Call reusable building workflow
uses: ./.github/workflows/building.yml
create_release_and_upload_packages:
name: Uplodad to Github Release
needs: [build_wheels]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download packages
id: download_artifacts
uses: actions/download-artifact@v3
with:
name: compiled_wheels_python${{ matrix.python-version }}
path: dist
- name: Upload packages to GitHub Release
id: upload_assets
run: |
for file in $(ls ./dist/*.*); do
echo "Uploading $file..."
filename=$(basename "$file")
encoded_filename=$(echo "$filename" | sed 's/+/%2B/g')
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/zip" \
--data-binary @"$file" \
"${{ github.event.release.upload_url }}=$encoded_filename"
done
generate_simple_index_pages:
name: Generate Simple Index Pages
needs: [create_release_and_upload_packages]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Generate Simple Index Pages
run: python .github/workflows/generate_simple_index_pages.py --outdir ./whl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./whl # Directory where the simple index pages are located
destination_dir: whl # The 'wh' folder in the GitHub Pages root
keep_files: false # This will only erase the destination subdirectory.
cname: docs.gsplat.studio
upload_pypi:
name: Upload to PyPi
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: pypi_packages
path: dist
- name: Install dependencies
run: |
python -m pip install build twine
shell: bash
# - name: Publish package to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload --username __token__ --password $PYPI_TOKEN dist/*
shell: bash