Welcome to mirror list, hosted at ThFree Co, Russian Federation.

publish_python-bareos_to_pypi.yml « workflows « .github - github.com/bareos/bareos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3e09deabd84e85f23dbb91ec8b555b6f9a045003 (plain)
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
name: "[Release] python-bareos -> https://pypi.org/"

on:
  push:
    tags:
      - Release/*

jobs:
  build-and-publish:
    name: "Build python-bareos and publish it to https://pypi.org/"
    runs-on: ubuntu-20.04

    steps:
    - name: "Checkout source"
      uses: actions/checkout@v2
      with:
        fetch-depth: 0

    - name: "Checkout tags"
      # for get-version.sh, an unshallow git checkout with tags is needed.
      run:  git fetch --tag

    - name: "Set up Python"
      uses: actions/setup-python@v2
      with:
        python-version: 3.7

    - name: "Build python package"
      run: |
        pip install --user wheel
        cd python-bareos
        # sdist mangles around with version information.
        # We replace ~pre with dev, as this will not be modified.
        # (pre will be replaced with rc).
        ../docs/manuals/source/get-version.sh > bareos/VERSION.txt
        printf "Version: %s\n" $(cat bareos/VERSION.txt)
        python setup.py sdist bdist_wheel

    - name: "Create artifact"
      # creating an artifact is not required for publishing to pypi.
      uses: actions/upload-artifact@v2
      with:
        path: python-bareos/dist/

    - name: "Publish to pypi.org"
      uses: pypa/gh-action-pypi-publish@v1.4.2
      with:
        password: ${{ secrets.pypi_password }}
        packages_dir: python-bareos/dist/