Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
br3ndonland committed Apr 9, 2024
1 parent b60a73d commit 0d616a0
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ci
on:
pull_request:
push:
branches: [develop, main]
branches: [develop, main, wip]
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
workflow_dispatch:
inputs:
Expand All @@ -16,27 +16,36 @@ jobs:
setup:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.set-env.outputs.environment }}
environment-name: ${{ steps.set-env.outputs.environment-name }}
environment-url: ${{ steps.set-env.outputs.environment-url }}
steps:
- uses: actions/checkout@v4
- name: Set GitHub Actions deployment environment
id: set-env
run: |
timestamp="$(date -Iseconds)"
url="https://api.github.com/repos/${{ github.repository }}/deployments"
if ${{ github.event_name == 'workflow_dispatch' }}; then
environment=${{ inputs.environment }}
environment_name=${{ inputs.environment }}
environment_url="$url?timestamp=$timestamp"
elif ${{ github.ref_type == 'tag' }}; then
environment="PyPI"
environment_name="PyPI"
environment_url="$url?timestamp=$timestamp"
else
environment=""
environment_name="wip"
environment_url="$url?timestamp=$timestamp"
fi
echo "environment=$environment" >>"$GITHUB_OUTPUT"
echo "environment-name=$environment_name" >>"$GITHUB_OUTPUT"
echo "environment-url=$environment_url" >>"$GITHUB_OUTPUT"
- name: Create annotation for deployment environment
if: steps.set-env.outputs.environment != ''
run: echo "::notice::Deployment environment ${{ steps.set-env.outputs.environment }}"
ci:
runs-on: ubuntu-latest
needs: [setup]
environment: ${{ needs.setup.outputs.environment }}
environment:
name: ${{ needs.setup.outputs.environment-name }}
url: ${{ needs.setup.outputs.environment-url }}-${{ matrix.python-version }}
permissions:
id-token: write
strategy:
Expand Down Expand Up @@ -127,7 +136,7 @@ jobs:
if: >
github.ref_type == 'tag' &&
matrix.python-version == '3.11' &&
needs.setup.outputs.environment == 'PyPI'
needs.setup.outputs.environment-name == 'PyPI'
uses: pypa/gh-action-pypi-publish@release/v1.8
changelog:
if: github.ref_type == 'tag'
Expand Down

0 comments on commit 0d616a0

Please sign in to comment.