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 b34d831
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 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,34 @@ 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: |
if ${{ github.event_name == 'workflow_dispatch' }}; then
environment=${{ inputs.environment }}
environment_name=${{ inputs.environment }}
elif ${{ github.ref_type == 'tag' }}; then
environment="PyPI"
environment_name="PyPI"
else
environment=""
environment_name=""
fi
echo "environment=$environment" >>"$GITHUB_OUTPUT"
timestamp="$(date -Iseconds)"
url="https://api.github.com/repos/${{ github.repository }}/deployments"
environment_url="$url?timestamp=$timestamp"
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 }}&python=${{ matrix.python-version }}
permissions:
id-token: write
strategy:
Expand Down Expand Up @@ -127,7 +134,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 b34d831

Please sign in to comment.