|
28 | 28 | |
29 | 29 | - name: Run tests |
30 | 30 | run: pytest tests/ -v |
| 31 | + |
| 32 | + get-next-version: |
| 33 | + needs: test |
| 34 | + uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@v4 |
31 | 35 |
|
| 36 | + update-version: |
| 37 | + needs: get-next-version |
| 38 | + runs-on: ubuntu-latest |
| 39 | + if: needs.get-next-version.outputs.new-release-published == 'true' |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + |
| 45 | + - name: Set up Python |
| 46 | + uses: actions/setup-python@v4 |
| 47 | + with: |
| 48 | + python-version: 3.11 |
| 49 | + |
| 50 | + - name: Install dependencies |
| 51 | + run: | |
| 52 | + python -m pip install --upgrade pip |
| 53 | + pip install -r requirements.txt |
| 54 | +
|
| 55 | + - name: Update version |
| 56 | + run: | |
| 57 | + echo "Updating version..." |
| 58 | + python scripts/update_version.py --next-version ${{ needs.get-next-version.outputs.new-release-version }} |
| 59 | +
|
| 60 | + - name: Upload updated version file |
| 61 | + uses: actions/upload-artifact@v4 |
| 62 | + with: |
| 63 | + name: version-file |
| 64 | + path: casbin_cli/__version__.py |
| 65 | + |
32 | 66 | build-binaries: |
33 | | - needs: test |
| 67 | + needs: update-version |
| 68 | + if: needs.get-next-version.outputs.new-release-published == 'true' |
34 | 69 | runs-on: ${{ matrix.os }} |
35 | 70 | strategy: |
36 | 71 | matrix: |
|
54 | 89 | python -m pip install --upgrade pip |
55 | 90 | pip install -r requirements.txt |
56 | 91 | pip install pyinstaller |
| 92 | +
|
| 93 | + - name: Download version file |
| 94 | + uses: actions/download-artifact@v4 |
| 95 | + with: |
| 96 | + name: version-file |
| 97 | + path: casbin_cli/ |
| 98 | + |
| 99 | + - name: Verify file content |
| 100 | + run: | |
| 101 | + echo "Content of __version__.py after update:" |
| 102 | + cat casbin_cli/__version__.py |
57 | 103 | |
58 | 104 | - name: Build binary |
59 | 105 | run: python scripts/build_binaries.py --platform ${{ matrix.platform }} |
@@ -85,8 +131,14 @@ jobs: |
85 | 131 | python -m pip install --upgrade pip |
86 | 132 | pip install -r requirements.txt |
87 | 133 | pip install wheel twine |
88 | | - npm install -g semantic-release @semantic-release/changelog @semantic-release/exec @semantic-release/github |
89 | | - |
| 134 | + npm install -g semantic-release @semantic-release/changelog @semantic-release/exec @semantic-release/github @semantic-release/git |
| 135 | +
|
| 136 | + - name: Download version file |
| 137 | + uses: actions/download-artifact@v4 |
| 138 | + with: |
| 139 | + name: version-file |
| 140 | + path: casbin_cli/ |
| 141 | + |
90 | 142 | - name: Download all artifacts |
91 | 143 | uses: actions/download-artifact@v4 |
92 | 144 | with: |
|
0 commit comments