File: release.yml

package info (click to toggle)
python-pbs-installer 2026.01.27-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 592 kB
  • sloc: python: 6,257; sh: 24; makefile: 2
file content (68 lines) | stat: -rw-r--r-- 1,642 bytes parent folder | download | duplicates (2)
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
name: Release

on:
  release:
    types:
      - created
  push:
    branches:
      - main
    tags:
      - "*"

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8, 3.11, 3.12]

    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip'

      - name: Install dependencies
        run: pip install .[all]

      - name: Run tests
        run: |
          pbs-install 3.10 -d test1 -v
          version=$(test1/bin/python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
          [[ $version == "3.10" ]] || exit 1

      - name: Run tests with build
        run: |
          pbs-install 3.10 -d test2 -v --build-dir
          version=$(test2/install/bin/python3 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
          [[ $version == "3.10" ]] || exit 1

  release:
    name: Build and Release
    runs-on: ubuntu-latest
    needs: test
    if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'repository_dispatch'
    permissions:
      id-token: write
    environment:
      name: release
      url: https://pypi.org/project/pbs-install/
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: actions/setup-python@v5
        with:
          python-version: 3.11
          cache: 'pip'

      - name: Build
        run: pipx run build

      - name: Publish package distributions to PyPI
        uses: pypa/gh-action-pypi-publish@release/v1