File: publish.yml

package info (click to toggle)
auth0-python 4.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,280 kB
  • sloc: python: 8,933; makefile: 15; sh: 2
file content (90 lines) | stat: -rw-r--r-- 3,167 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Publish Release

on:
  workflow_dispatch:

### TODO: Replace instances of './.github/actions/' with reference to the `dx-sdk-actions` repo is made public and this file is transferred over
### TODO: Also remove `get-prerelease`, `get-version`, `release-create`, `tag-create` and `tag-exists` actions from this repo's .github/actions folder once the repo is public.

permissions:
  contents: write
  id-token: write # Required for trusted publishing to PyPI

jobs:
  rl-scanner:
    uses: ./.github/workflows/rl-scanner.yml
    with:
      python-version: "3.10"
      artifact-name: "auth0-python.tgz"
    secrets:
      RLSECURE_LICENSE: ${{ secrets.RLSECURE_LICENSE }}
      RLSECURE_SITE_KEY: ${{ secrets.RLSECURE_SITE_KEY }}
      SIGNAL_HANDLER_TOKEN: ${{ secrets.SIGNAL_HANDLER_TOKEN }}
      PRODSEC_TOOLS_USER: ${{ secrets.PRODSEC_TOOLS_USER }}
      PRODSEC_TOOLS_TOKEN: ${{ secrets.PRODSEC_TOOLS_TOKEN }}
      PRODSEC_TOOLS_ARN: ${{ secrets.PRODSEC_TOOLS_ARN }}
  publish-pypi:
    if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged && startsWith(github.event.pull_request.head.ref, 'release/'))
    name: "PyPI"
    runs-on: ubuntu-latest
    needs: rl-scanner
    environment: release

    steps:
      - name: Checkout code
        uses: actions/checkout@v5
        with:
          fetch-depth: 0
          fetch-tags: true

      # Get the version from the branch name
      - id: get_version
        uses: ./.github/actions/get-version

      # Get the prerelease flag from the branch name
      - id: get_prerelease
        uses: ./.github/actions/get-prerelease
        with:
          version: ${{ steps.get_version.outputs.version }}

      # Get the release notes
      # This will expose the release notes as env.RELEASE_NOTES
      - id: get_release_notes
        uses: ./.github/actions/get-release-notes
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          version: ${{ steps.get_version.outputs.version }}
          repo_owner: ${{ github.repository_owner }}
          repo_name: ${{ github.event.repository.name }}

      # Create a release for the tag
      - uses: ./.github/actions/release-create
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          name: ${{ steps.get_version.outputs.version }}
          body: ${{ steps.get_release_notes.outputs.release-notes }}
          tag: ${{ steps.get_version.outputs.version }}
          commit: ${{ github.sha }}
          prerelease: ${{ steps.get_prerelease.outputs.prerelease }}

      - name: Configure Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.9"

      - name: Configure dependencies
        run: |
          pip install --user --upgrade pip
          pip install --user pipx
          pipx ensurepath
          pipx install poetry
          poetry config virtualenvs.in-project true
          poetry install --with dev
          poetry self add "poetry-dynamic-versioning[plugin]"

      - name: Build release
        run: |
          poetry build

      - name: Publish release
        uses: pypa/gh-action-pypi-publish@release/v1