File: deploy.yml

package info (click to toggle)
dpath-python 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 256 kB
  • sloc: python: 1,671; makefile: 3
file content (68 lines) | stat: -rw-r--r-- 2,236 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: Deploy and Release

# Controls when the workflow will run
on:
  # Triggers the workflow on version change
  push:
    branches: 
      - master
    paths:
      - dpath/version.py

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "deploy"
  deploy:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: Get Version
        id: get-version
        run: |
          python -c "from dpath.version import VERSION; print(f'::set-output name=version::v{VERSION}');"

      - name: Check Tag
        uses: mukunku/tag-exists-action@v1.0.0
        id: check-tag
        with:
          tag: ${{ steps.get-version.outputs.version }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Create Tag
        if: steps.check-tag.outputs.exists == 'false'
        uses: negz/create-tag@v1
        with:
          version: ${{ steps.get-version.outputs.version }}
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Generate Changelog
        id: generate-changelog
        uses: loopwerk/tag-changelog@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          config_file: .github/tag-changelog-config.js

      - name: PyPI Deployment
        uses: casperdcl/deploy-pypi@v2
        with:
          # PyPI username
          user: ${{ secrets.PYPI_USER }}
          # PyPI password or API token
          password: ${{ secrets.PYPI_PASS }}
          # `setup.py` command to run ("true" is a shortcut for "clean sdist -d <dist_dir> bdist_wheel -d <dist_dir>")
          build: clean sdist -d dist/
          # `pip` command to run ("true" is a shortcut for "wheel -w <dist_dir> --no-deps .")
          pip: true

      - name: Github Release
        uses: softprops/action-gh-release@v1
        with:
          tag_name: ${{ steps.get-version.outputs.version }}
          body: ${{ steps.generate-changelog.outputs.changes }}
          files: dist/*