use `WIPACrepo/wipac-dev-workflows/.github/workflows/tag-and-release.… #131
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: ci/cd | |
| on: | |
| push: | |
| branches: [ '**' ] | |
| tags-ignore: [ '**' ] | |
| jobs: | |
| py-versions: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.versions.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.sha }} # lock to triggered commit ('github.ref' is dynamic) | |
| - id: versions | |
| uses: WIPACrepo/[email protected] | |
| ############################################################################ | |
| # LINTERS | |
| ############################################################################ | |
| flake8: | |
| needs: [ py-versions ] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| py3: ${{ fromJSON(needs.py-versions.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.sha }} # lock to triggered commit ('github.ref' is dynamic) | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.py3 }} | |
| - uses: WIPACrepo/[email protected] | |
| with: | |
| max-complexity: 10 # ideal is ~10-15 | |
| mypy: | |
| needs: [ py-versions ] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| py3: ${{ fromJSON(needs.py-versions.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.sha }} # lock to triggered commit ('github.ref' is dynamic) | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.py3 }} | |
| - uses: WIPACrepo/[email protected] | |
| ############################################################################ | |
| # PACKAGING | |
| ############################################################################ | |
| py-setup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| ref: ${{ github.ref }} # dont lock to sha (action needs to push) | |
| - uses: WIPACrepo/[email protected] | |
| with: | |
| pypi_name: 'wipac-dev-actions-testbed' | |
| python_min: 3.12 | |
| author: WIPAC Developers | |
| author_email: [email protected] | |
| keywords_comma: "WIPAC, CI/CD, gitops, testbed" | |
| auto_mypy_option: True | |
| py-dependencies: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| ref: ${{ github.ref }} # dont lock to sha (action needs to push) | |
| - uses: WIPACrepo/[email protected] | |
| ############################################################################ | |
| # TESTS | |
| ############################################################################ | |
| # :o) | |
| ############################################################################ | |
| # TAG NEW VERSION & MAKE RELEASE | |
| ############################################################################ | |
| tag-and-release: | |
| # only run on main/default | |
| if: format('refs/heads/{0}', github.event.repository.default_branch) == github.ref | |
| needs: | |
| - py-versions | |
| - flake8 | |
| - mypy | |
| - py-setup | |
| - py-dependencies | |
| uses: WIPACrepo/wipac-dev-workflows/.github/workflows/[email protected] | |
| with: | |
| project-type: python | |
| python-version: "${{ fromJSON(needs.py-versions.outputs.matrix)[0] }}" | |
| release-artifacts: | | |
| py-dependencies-logs | |
| publish-to-pypi: true | |
| secrets: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |