Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release CI: Run on all pushes and PRs, only publish on tag #1479

Merged
merged 2 commits into from
Oct 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
name: Release
on:
release:
types:
- published
push:
branches:
- main
- release**
paths-ignore:
- '**.md'
- '**.rst'
pull_request:
paths-ignore:
- '**.md'
- '**.rst'
workflow_dispatch:

permissions:
id-token: write
Expand All @@ -19,16 +28,17 @@ jobs:
with:
python-version: "3.12"
- name: Install dependencies
run: pip install -U pip wheel setuptools
- name: Build package
run: python setup.py sdist bdist_wheel
run: pip install -U pip build wheel setuptools
- name: Build distributions
run: python -m build
- name: Upload package as artifact to GitHub
if: github.repository == 'projectmesa/mesa' && startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v3
with:
name: package
path: dist/
- name: Upload packages to PyPI
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
password: ${{ secrets.PYPI_API_TOKEN }}