forked from pyQode/pyqode.core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action workflow for build/release
- Loading branch information
1 parent
a71a2fb
commit c2513b9
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.8' | ||
- name: Build sdist | ||
run: | | ||
python -m pip install --user build | ||
python -m build --sdist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: source | ||
path: dist/*.tar.gz | ||
|
||
upload_pypi: | ||
name: Upload wheels to PyPI | ||
needs: [build_sdist] | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/pyqodeng | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
# Upload to PyPI on every tag starting with 'v' | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
- run: | | ||
mkdir dist | ||
find artifacts -type f -exec mv {} dist \; | ||
- uses: pypa/gh-action-pypi-publish@release/v1 |