feat: add --no-exec flag to play command for debugging #35
This file contains hidden or 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
| name: Release | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| issues: write | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: | | |
| pip install build | |
| npm install -g semantic-release @semantic-release/exec @semantic-release/github @semantic-release/git | |
| - name: Run tests | |
| run: | | |
| pip install -e ".[dev]" | |
| python -m pytest | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Release | |
| id: release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Store semantic-release output to check if a release was made | |
| if npx semantic-release --dry-run=false 2>&1 | tee sr_output.log | grep -q "There are no relevant changes"; then | |
| echo "released=false" >> $GITHUB_OUTPUT | |
| echo "No release published" | |
| else | |
| echo "released=true" >> $GITHUB_OUTPUT | |
| echo "Release published" | |
| fi | |
| - name: Publish to PyPI | |
| if: steps.release.outputs.released == 'true' | |
| uses: pypa/gh-action-pypi-publish@release/v1 |