|
1 | 1 | name: Release |
2 | 2 | on: |
3 | | - push: |
4 | | - branches: |
5 | | - - master |
6 | | - workflow_dispatch: { } |
7 | | - |
8 | | -jobs: |
9 | | - find_version: |
10 | | - name: Find Version |
11 | | - runs-on: ubuntu-latest |
12 | | - outputs: |
13 | | - version: ${{ steps.get-version.outputs.version }} |
14 | | - steps: |
15 | | - - name: Checkout source |
16 | | - uses: actions/checkout@v2.3.2 |
17 | | - - name: Set up Python |
18 | | - uses: actions/setup-python@v2 |
19 | | - with: |
20 | | - python-version: 3.7 |
21 | | - - name: Get version |
22 | | - id: get-version |
23 | | - run: python -c 'import splunklib; print("::set-output name=version::%s" % splunklib.__version__)' |
24 | | - - name: Install tox |
25 | | - run: pip install tox |
26 | | - - name: Generate API docs |
27 | | - run: | |
28 | | - rm -rf ./docs/_build |
29 | | - tox -e docs |
30 | | - cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX" |
31 | | - tag_version: |
32 | | - needs: find_version |
33 | | - name: Tag Version |
34 | | - runs-on: ubuntu-latest |
35 | | - steps: |
36 | | - - name: Create tag |
37 | | - uses: tvdias/github-tagger@v0.0.2 |
38 | | - with: |
39 | | - repo-token: ${{ secrets.GITHUB_TOKEN }} |
40 | | - tag: ${{ needs.find_version.outputs.version }} |
41 | 3 | release: |
42 | | - needs: [ find_version, tag_version ] |
43 | | - name: Create Release |
44 | | - runs-on: ubuntu-latest |
45 | | - steps: |
46 | | - - name: Checkout code |
47 | | - uses: actions/checkout@v2.3.2 |
48 | | - - name: Create Release |
49 | | - id: create_release |
50 | | - uses: actions/create-release@v1 |
51 | | - env: |
52 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
53 | | - with: |
54 | | - tag_name: ${{ needs.find_version.outputs.version }} |
55 | | - release_name: Release/${{ needs.find_version.outputs.version }} |
56 | | - body: | |
57 | | - ## Version ${{ needs.find_version.outputs.version }} |
| 4 | + types: [published] |
58 | 5 |
|
59 | | - **TODO: Insert CHANGELOG.md contents here.** |
60 | | - draft: false |
61 | | - prerelease: false |
62 | | - - name: Upload Artifact |
63 | | - uses: actions/upload-artifact@v3 |
64 | | - with: |
65 | | - name: apidocs |
66 | | - path: docs/_build/docs_html.zip |
| 6 | +jobs: |
67 | 7 | publish: |
68 | | - needs: release |
69 | 8 | name: Deploy Release to PyPI |
70 | 9 | runs-on: ubuntu-latest |
71 | 10 | steps: |
|
84 | 23 | with: |
85 | 24 | user: __token__ |
86 | 25 | password: ${{ secrets.pypi_password }} |
| 26 | + - name: Install tox |
| 27 | + run: pip install tox |
| 28 | + - name: Generate API docs |
| 29 | + run: | |
| 30 | + rm -rf ./docs/_build |
| 31 | + tox -e docs |
| 32 | + cd ./docs/_build/html && zip -r ../docs_html.zip . -x ".*" -x "__MACOSX" |
| 33 | + - name : Docs Upload |
| 34 | + uses: actions/upload-artifact@v3 |
| 35 | + with: |
| 36 | + name: apidocs |
| 37 | + path: docs/_build/docs_html.zip |
87 | 38 | # Test upload |
88 | 39 | # - name: Publish package to TestPyPI |
89 | 40 | # uses: pypa/gh-action-pypi-publish@master |
|
0 commit comments