Skip to content

Commit

Permalink
Use dev GitHub environment for prereleases (#14188)
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle committed Jun 20, 2024
1 parent fbb4247 commit 5baa7cc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/docker-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types: [released, prereleased]
# On each commit merged into main, push sha and branch patterns to prefect-dev
push:
branches: main
branches: [main]
paths:
- "Dockerfile"
- ".dockerignore"
Expand All @@ -30,7 +30,7 @@ jobs:
publish-docker-images:
name: Build and publish to DockerHub
runs-on: ubuntu-latest
environment: ${{ ( github.event_name == 'release' && 'prod' ) || 'dev' }}
environment: ${{ github.event_name == 'release' && !github.event.release.prerelease && 'prod' || 'dev' }}
strategy:
matrix:
flavor:
Expand All @@ -44,6 +44,14 @@ jobs:
- "3.12"

steps:
- name: Validate Prerelease Tag
if: ${{ github.event_name == 'release' && github.event.release.prerelease == true }}
run: |
TAG_NAME=${{ github.ref }}
if [[ ! "$TAG_NAME" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9]+$ ]]; then
echo "Error: Tag $TAG_NAME does not match prerelease version pattern."
exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/prefect-client-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ jobs:
upload-artifacts: true
artifact-name: "prefect-client-pypi-dists"
secrets: inherit

publish-prefect-client-pypi-dists:
name: Publish to PyPI
environment: "prod"
environment: ${{ github.event.release.prerelease && 'dev' || 'prod' }}
needs: [verify-prefect-client-build]
runs-on: ubuntu-latest

steps:
- name: Validate Prerelease Tag
if: ${{ github.event_name == 'release' && github.event.release.prerelease == true }}
run: |
TAG_NAME=${{ github.ref }}
if [[ ! "$TAG_NAME" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9]+$ ]]; then
echo "Error: Tag $TAG_NAME does not match prerelease version pattern."
exit 1
fi
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,20 @@ jobs:

publish-pypi-dists:
name: Publish to PyPI
environment: "prod"
environment: ${{ github.event.release.prerelease && 'dev' || 'prod' }}
needs: [build-pypi-dists]
runs-on: ubuntu-latest

steps:
- name: Validate Prerelease Tag
if: ${{ github.event_name == 'release' && github.event.release.prerelease == true }}
run: |
TAG_NAME=${{ github.ref }}
if [[ ! "$TAG_NAME" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+[a-zA-Z0-9]+$ ]]; then
echo "Error: Tag $TAG_NAME does not match prerelease version pattern."
exit 1
fi
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
Expand Down

0 comments on commit 5baa7cc

Please sign in to comment.