File: cd.yml

package info (click to toggle)
python-b2sdk 2.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,228 kB
  • sloc: python: 32,094; sh: 13; makefile: 8
file content (55 lines) | stat: -rw-r--r-- 1,980 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
name: Continuous Delivery

on:
  push:
    tags: ['v*']  # push events to matching v*, i.e. v1.0, v20.15.10

env:
  PYTHON_DEFAULT_VERSION: "3.12"

jobs:
  deploy:
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      B2_PYPI_PASSWORD: ${{ secrets.B2_PYPI_PASSWORD }}
    runs-on: ubuntu-latest
    steps:
      - name: Determine if pre-release
        id: prerelease_check
        run: |
          export IS_PRERELEASE=$([[ ${{ github.ref }} =~ [^0-9]$ ]] && echo true || echo false)
          echo "prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
      - name: Display Python version
        run: python -c "import sys; print(sys.version)"
      - name: Install dependencies
        run: python -m pip install --upgrade nox pdm
      - name: Build the distribution
        id: build
        run: nox -vs build
      - name: Read the Changelog
        id: read-changelog
        uses: mindsers/changelog-reader-action@v2
        with:
          version: ${{ steps.build.outputs.version }}
      - name: Create GitHub release and upload the distribution
        id: create-release
        uses: softprops/action-gh-release@v2
        with:
          name: ${{ steps.build.outputs.version }}
          body: ${{ steps.read-changelog.outputs.changes }}
          draft: ${{ env.ACTIONS_STEP_DEBUG == 'true' }}
          prerelease: ${{ steps.prerelease_check.outputs.prerelease }}
          files: ${{ steps.build.outputs.asset_path }}
      - name: Upload the distribution to PyPI
        if: ${{ env.B2_PYPI_PASSWORD != '' && steps.prerelease_check.outputs.prerelease == 'false' }}
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          user: __token__
          password: ${{ secrets.B2_PYPI_PASSWORD }}