|
15 | 15 | - name: Get tag
|
16 | 16 | id: vars
|
17 | 17 | run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
| 18 | + - name: Validate version number |
| 19 | + run: >- |
| 20 | + if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then |
| 21 | + if ! [[ "${{ steps.vars.outputs.tag }}" =~ "b" ]]; then |
| 22 | + echo "Pre-release: Tag is missing beta suffix (${{ steps.vars.outputs.tag }})" |
| 23 | + exit 1 |
| 24 | + fi |
| 25 | + else |
| 26 | + if [[ "${{ steps.vars.outputs.tag }}" =~ "b" ]]; then |
| 27 | + echo "Release: Tag must not have a beta suffix (${{ steps.vars.outputs.tag }})" |
| 28 | + exit 1 |
| 29 | + fi |
| 30 | + fi |
18 | 31 | - name: Set up Python 3.10
|
19 | 32 | uses: actions/setup-python@v5.0.0
|
20 | 33 | with:
|
|
67 | 80 | echo "patch=${patch}" >> $GITHUB_OUTPUT
|
68 | 81 | echo "minor=${patch%.*}" >> $GITHUB_OUTPUT
|
69 | 82 | echo "major=${patch%.*.*}" >> $GITHUB_OUTPUT
|
70 |
| - - name: Build and Push |
| 83 | + - name: Build and Push release |
71 | 84 | uses: docker/build-push-action@v5.1.0
|
| 85 | + if: github.event.release.prerelease == false |
72 | 86 | with:
|
73 | 87 | context: .
|
74 | 88 | platforms: linux/amd64,linux/arm64
|
|
81 | 95 | push: true
|
82 | 96 | build-args:
|
83 | 97 | "PYTHON_MATTER_SERVER=${{ needs.build-and-publish-pypi.outputs.version }}"
|
| 98 | + - name: Build and Push pre-release |
| 99 | + uses: docker/build-push-action@v5.1.0 |
| 100 | + if: github.event.release.prerelease == true |
| 101 | + with: |
| 102 | + context: . |
| 103 | + platforms: linux/amd64,linux/arm64 |
| 104 | + file: Dockerfile |
| 105 | + tags: |- |
| 106 | + ghcr.io/${{ github.repository_owner }}/python-matter-server:${{ steps.tags.outputs.patch }}, |
| 107 | + ghcr.io/${{ github.repository_owner }}/python-matter-server:beta |
| 108 | + push: true |
| 109 | + build-args: |
| 110 | + "PYTHON_MATTER_SERVER=${{ needs.build-and-publish-pypi.outputs.version }}" |
0 commit comments