Skip to content

Commit

Permalink
Fixes to release workflow. (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Thorogood authored Jan 6, 2022
1 parent 8f53c68 commit 0a4cf6d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
51 changes: 19 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,29 @@ jobs:
project_id: ${{ secrets.IAM_GCR_REPO }}
service_account_key: ${{ secrets.GCR_TOKEN }}
export_default_credentials: true
uses: google-github-actions/setup-gcloud@master
uses: google-github-actions/setup-gcloud@v0.3.0

- uses: actions/setup-python@v2
with:
python-version: 3.7

- uses: abatilo/[email protected]

- uses: nanasess/[email protected]
- uses: abatilo/[email protected]
- uses: nanasess/setup-chromedriver@v1

- run: |
poetry version ${{ github.event.inputs.patch-level || 'prerelease' }}
set -x
VERSION=$(poetry version -s)
echo "::set-output name=release-version::$VERSION"
echo "::set-output name=short-sha::${GITHUB_SHA:0:10}"
poetry install
poetry install --no-interaction
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
echo "SLACK_CANVAS_ID=${{ github.event_name }}/$VERSION" >> $GITHUB_ENV
id: configure
- uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
- uses: UWIT-IAM/actions/[email protected]
id: slack
env:
version: ${{ steps.configure.outputs.release-version }}
with:
command: create-canvas
channel: '#iam-bots' # Currently this duplicated field is required
description: "${{ github.workflow }}"
json: >
{
"canvasId": "${{ env.SLACK_CANVAS_ID }}",
"description": "${{ github.workflow }}",
"description": "${{ github.workflow }}: ${{ env.version }}",
"status": "in progress",
"channel": "#iam-bots",
"steps": [
Expand All @@ -92,7 +85,8 @@ jobs:
}
]
}
- uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
- uses: UWIT-IAM/actions/[email protected]
env:
commit_url: >
https://github.com/${{ github.repository }}/commit/${{ github.sha }}
Expand All @@ -106,8 +100,8 @@ jobs:
- run: ./validate-strict.sh
id: run-tests

- if: always()
uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
- if: always() && steps.slack.outputs.canvas-id
uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1.8
env:
test-status: ${{ steps.run-tests.outcome == 'success' && 'succeeded' || 'failed' }}
release-status: ${{ steps.run-tests.outcome == 'success' && 'in progress' || 'not started' }}
Expand Down Expand Up @@ -141,7 +135,7 @@ jobs:
commit: ${{ steps.version-commit.outputs.sha }}
tag: ${{ steps.configure.outputs.release-version }}

- uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
- uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1.8
env:
release_version: ${{ steps.configure.outputs.release-version }}
release_url: ${{ steps.create-release.outputs.html_url || 'https://www.example.com' }}
Expand All @@ -156,24 +150,17 @@ jobs:
if: env.dry_run != 'true'
id: publish-release

- if: always()
- if: always() && steps.slack.outputs.canvas-id
env:
status: ${{ job.status != 'failure' && 'succeeded' || 'failed' }}
with:
command: update-workflow
step-id: release
step-status: ${{ env.status }}
workflow-status: ${{ env.status }}
uses: UWIT-IAM/actions/update-slack-workflow-canvas@main

- if: always()
uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
with:
command: remove-step
step-id: '*'
step-status: succeeded
uses: UWIT-IAM/actions/[email protected]

- if: always()
uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
- if: always() && steps.slack.outputs.canvas-id
uses: UWIT-IAM/actions/finalize-slack-notification-canvas@0.1.8
with:
command: finalize-workflow
workflow-status: ${{ job.status == 'success' && 'succeeded' || 'failed' }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "uw-webdriver-recorder"
# This version string is typically managed by the CI workflow,
# and is changed anytime `poetry version [new version]` is run.
# Do not revert this manually.
version = "5.0.0-alpha.12"
version = "5.0.0-alpha.13"
description = "A pytest plugin for recording screenshots of selenium interactions, with other convenient features too."
authors = ["Tom Thorogood <[email protected]>"]
license = "Apache Software License 3.0"
Expand Down
2 changes: 1 addition & 1 deletion validate-strict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
# This command cuts and re-splices the default tox
# env to replace the "black" env with the "black_check" env.
tox_envs=$(poetry run tox -l | sed '/^\\$/d' | sed 's|black|black_check|g' | paste -sd "," -)
set -x
set -ex
poetry run tox -e ${tox_envs}

0 comments on commit 0a4cf6d

Please sign in to comment.