Skip to content

Commit f5cf3b3

Browse files
author
Thomas Thorogood
authored
Re-sync branch from test branch, which had the actually functioning release workflow. (#24)
1 parent 41b7610 commit f5cf3b3

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/create-release.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v2
2121
- uses: abatilo/actions-poetry@v2.1.4
22+
- run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
2223
- with:
2324
project_id: ${{ secrets.IAM_GCR_REPO }}
2425
service_account_key: ${{ env.GCLOUD_TOKEN }}
@@ -27,14 +28,17 @@ jobs:
2728

2829
- run: |
2930
echo "::set-output name=version::$(poetry version -s)"
30-
echo "::set-output name=short-sha::${${{ github.sha }}:0:10}"
31+
echo "::set-output name=short-sha::${GITHUB_SHA:0:10}"
3132
id: configure
3233
3334
- uses: UWIT-IAM/actions/set-up-slack-notification-canvas@0.1.8
35+
id: create-canvas
36+
env:
37+
description_prefix: ${{ env.dry_run && '[DRY RUN] ' || '' }}
3438
with:
3539
json: >
3640
{
37-
"description": "${{ github.workflow }}",
41+
"description": "${{ env.description_prefix }}${{ github.workflow }}",
3842
"status": "in progress",
3943
"channel": "#iam-bots",
4044
"steps": [
@@ -55,7 +59,8 @@ jobs:
5559
]
5660
}
5761
58-
- uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
62+
- uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1.8
63+
if: steps.create-canvas.outputs.canvas-id
5964
env:
6065
commit_url: >
6166
https://github.com/${{ github.repository }}/commit/${{ github.sha }}
@@ -69,8 +74,8 @@ jobs:
6974
- run: ./scripts/pre-push.sh --check-only
7075
id: run-tests
7176

72-
- if: always()
73-
uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
77+
- if: always() && steps.create-canvas.outputs.canvas-id
78+
uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1.8
7479
env:
7580
test-status: ${{ steps.run-tests.outcome == 'success' && 'succeeded' || 'failed' }}
7681
release-status: ${{ steps.run-tests.outcome == 'success' && 'in progress' || 'not started' }}
@@ -87,7 +92,8 @@ jobs:
8792
commit: ${{ github.sha }}
8893
tag: ${{ steps.configure.outputs.version }}
8994

90-
- uses: UWIT-IAM/actions/update-slack-workflow-canvas@main
95+
- uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1.8
96+
if: success() && steps.create-canvas.outputs.canvas-id
9197
env:
9298
release_version: ${{ steps.configure.outputs.version }}
9399
release_url: ${{ steps.create-release.outputs.html_url || 'https://www.example.com' }}
@@ -97,14 +103,14 @@ jobs:
97103
description: >
98104
${{ env.action_desc }} release
99105
<${{ env.release_url }} | ${{ env.release_version }}>
100-
101106
- run: |
107+
set -x
102108
poetry publish \
103109
--build \
104110
$(test "${{ env.dry_run }}" == "false" || echo "--dry-run")
105111
id: publish-release
106112
107-
- if: always()
113+
- if: always() && steps.create-canvas.outputs.canvas-id
108114
uses: UWIT-IAM/actions/finalize-slack-notification-canvas@0.1.8
109115
with:
110116
workflow-status: ${{ job.status == 'failure' && 'failed' || 'succeeded' }}

0 commit comments

Comments
 (0)