From 0d616a082b75680fff2eb6812abfed23c206fc94 Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Tue, 9 Apr 2024 02:43:19 -0400 Subject: [PATCH] WIP --- .github/workflows/ci.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb85695..bd1a9d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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: @@ -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'