Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pre-releases with version suffix #529

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ jobs:
- name: Get tag
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Validate version number
run: >-
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
if ! [[ "${{ steps.vars.outputs.tag }}" =~ "b" ]]; then
echo "Pre-release: Tag is missing beta suffix (${{ steps.vars.outputs.tag }})"
exit 1
fi
else
if [[ "${{ steps.vars.outputs.tag }}" =~ "b" ]]; then
echo "Release: Tag must not have a beta suffix (${{ steps.vars.outputs.tag }})"
exit 1
fi
fi
- name: Set up Python 3.10
uses: actions/setup-python@v5.0.0
with:
Expand Down Expand Up @@ -67,8 +80,9 @@ jobs:
echo "patch=${patch}" >> $GITHUB_OUTPUT
echo "minor=${patch%.*}" >> $GITHUB_OUTPUT
echo "major=${patch%.*.*}" >> $GITHUB_OUTPUT
- name: Build and Push
- name: Build and Push release
uses: docker/build-push-action@v5.1.0
if: github.event.release.prerelease == false
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -81,3 +95,16 @@ jobs:
push: true
build-args:
"PYTHON_MATTER_SERVER=${{ needs.build-and-publish-pypi.outputs.version }}"
- name: Build and Push pre-release
uses: docker/build-push-action@v5.1.0
if: github.event.release.prerelease == true
with:
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
tags: |-
ghcr.io/${{ github.repository_owner }}/python-matter-server:${{ steps.tags.outputs.patch }},
ghcr.io/${{ github.repository_owner }}/python-matter-server:beta
push: true
build-args:
"PYTHON_MATTER_SERVER=${{ needs.build-and-publish-pypi.outputs.version }}"