Do not install git-fame script for argopt (#20) #106
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| pull_request: | |
| schedule: [{cron: '3 2 1 * *'}] # M H d m w (monthly at 2:03) | |
| jobs: | |
| test: | |
| if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association) | |
| name: py${{ matrix.python }}-${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu] | |
| python: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12] | |
| include: | |
| - {os: macos, python: 3.12} | |
| - {os: windows, python: 3.12} | |
| runs-on: ${{ matrix.os }}-${{ matrix.python == 3.7 && '22.04' || 'latest' }} | |
| defaults: {run: {shell: bash}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: {fetch-depth: 0} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install | |
| run: pip install -U tox tox-gh-actions | |
| - name: Test | |
| run: tox -e py${PYVER/./} | |
| env: | |
| PYVER: ${{ matrix.python }} | |
| PLATFORM: ${{ matrix.os }} | |
| COVERALLS_FLAG_NAME: py${{ matrix.python }}-${{ matrix.os }} | |
| COVERALLS_PARALLEL: true | |
| COVERALLS_SERVICE_NAME: github | |
| # coveralls needs explicit token | |
| COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| finish: | |
| name: Coverage | |
| continue-on-error: ${{ github.event_name != 'push' }} | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Coveralls Finished | |
| run: | | |
| pip install -U coveralls | |
| coveralls --finish || : | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| deploy: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: {contents: write, id-token: write, packages: write} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: {fetch-depth: 0} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - id: dist | |
| uses: casperdcl/deploy-pypi@v2 | |
| with: | |
| build: true | |
| gpg_key: ${{ secrets.GPG_KEY }} | |
| upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} | |
| - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| name: Release | |
| run: | | |
| changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD) | |
| tag="${GITHUB_REF#refs/tags/}" | |
| gh release create --title "argopt $tag stable" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.whl }} dist/${{ steps.dist.outputs.whl_asc }} | |
| env: | |
| GH_TOKEN: ${{ github.token }} |