|
1 | | -name: 'Release' |
| 1 | +name: "Release" |
2 | 2 |
|
3 | 3 | on: |
4 | | - - workflow_dispatch |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + paths: |
| 8 | + - "posthog/version.py" |
| 9 | + workflow_dispatch: |
5 | 10 |
|
6 | 11 | jobs: |
7 | | - release: |
8 | | - name: Publish release |
9 | | - runs-on: ubuntu-latest |
10 | | - env: |
11 | | - TWINE_USERNAME: __token__ |
12 | | - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |
13 | | - steps: |
14 | | - - name: Checkout the repository |
15 | | - uses: actions/checkout@v2 |
16 | | - with: |
17 | | - fetch-depth: 0 |
18 | | - token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} |
| 12 | + release: |
| 13 | + name: Publish release |
| 14 | + runs-on: ubuntu-latest |
| 15 | + env: |
| 16 | + TWINE_USERNAME: __token__ |
| 17 | + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |
| 18 | + steps: |
| 19 | + - name: Checkout the repository |
| 20 | + uses: actions/checkout@v2 |
| 21 | + with: |
| 22 | + fetch-depth: 0 |
| 23 | + token: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} |
19 | 24 |
|
20 | | - - name: Set up Python |
21 | | - uses: actions/setup-python@v2 |
| 25 | + - name: Set up Python |
| 26 | + uses: actions/setup-python@v2 |
22 | 27 |
|
23 | | - - name: Detect version |
24 | | - run: echo "REPO_VERSION=$(python3 posthog/version.py)" >> $GITHUB_ENV |
| 28 | + - name: Detect version |
| 29 | + run: echo "REPO_VERSION=$(python3 posthog/version.py)" >> $GITHUB_ENV |
25 | 30 |
|
26 | | - - name: Prepare for building release |
27 | | - run: pip install -U pip setuptools wheel twine |
| 31 | + - name: Prepare for building release |
| 32 | + run: pip install -U pip setuptools wheel twine |
28 | 33 |
|
29 | | - - name: Push release to PyPI |
30 | | - run: make release && make release_analytics |
| 34 | + - name: Push release to PyPI |
| 35 | + run: make release && make release_analytics |
31 | 36 |
|
32 | | - - name: Create GitHub release |
33 | | - uses: actions/create-release@v1 |
34 | | - env: |
35 | | - GITHUB_TOKEN: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} |
36 | | - with: |
37 | | - tag_name: v${{ env.REPO_VERSION }} |
38 | | - release_name: ${{ env.REPO_VERSION }} |
| 37 | + - name: Create GitHub release |
| 38 | + uses: actions/create-release@v1 |
| 39 | + env: |
| 40 | + GITHUB_TOKEN: ${{ secrets.POSTHOG_BOT_GITHUB_TOKEN }} |
| 41 | + with: |
| 42 | + tag_name: v${{ env.REPO_VERSION }} |
| 43 | + release_name: ${{ env.REPO_VERSION }} |
0 commit comments