File: CD.yml

package info (click to toggle)
dioptas 0.6.1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 163,396 kB
  • sloc: python: 28,770; makefile: 24; xml: 9; sh: 3
file content (71 lines) | stat: -rw-r--r-- 1,864 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
69
70
71
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: CD

on:
  release:
    types: [ published ]

jobs:
  build_package:
    strategy:
      fail-fast: false
      matrix:
        os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
        python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Install Poetry on macOS and Linux - Fails on windows for some reason
        if: ${{ matrix.os != 'windows-latest' }}
        uses: snok/install-poetry@v1

      - name: Install Poetry on windows
        if: ${{ matrix.os == 'windows-latest' }}
        run: pipx install poetry

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'poetry'

      - name: Add Dynamic Versioning Plugin
        run: |
          poetry self add poetry-dynamic-versioning[plugin]

      - name: Build Package
        run: poetry build

      - name: Upload wheels to artifact
        uses: actions/upload-artifact@v3
        with:
          name: wheels
          path: dist/*

  pypi-publish:
    name: Upload release to PyPI
    needs: build_package
    runs-on: ubuntu-latest
    environment:
      name: pypi
      url: https://pypi.org/p/dioptas/
    permissions:
      id-token: write
    steps:
      - uses: actions/download-artifact@v3
        with:
          name: wheels
          path: dist

      - name: check the dist folder
        run: ls dist

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