/ .github / workflows / publish-release.yml
publish-release.yml
 1  name: Publish Liger Kernel on Release
 2  
 3  on:
 4    release:
 5      types: [published]
 6  
 7  jobs:
 8    build:
 9      runs-on: ubuntu-latest
10  
11      steps:
12      - name: Checkout repository
13        uses: actions/checkout@v3
14  
15      - name: Set up Python
16        uses: actions/setup-python@v3
17        with:
18          python-version: '3.10'
19  
20      - name: Install dependencies
21        run: |
22          python -m pip install --upgrade pip
23          pip install build twine wheel toml
24  
25      - name: Build package
26        run: |
27          python -m build
28  
29      - name: Publish package to PyPI
30        env:
31          TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
32          TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
33        run: |
34          twine upload dist/*
35  
36      - name: Create release notes
37        run: |
38          echo "Release published to PyPI with the name 'liger-kernel'."