Skip to content

Commit 08973b3

Browse files
authored
chore(ci): prepare CI actions for v1 releases (#1621)
* chore: prepare v1 actions * fix: remove post_release job
1 parent ddfd50e commit 08973b3

14 files changed

+24
-186
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [develop, v2]
5+
branches: [v1]
66

77
jobs:
88
analyze:

.github/workflows/on_push_docs.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/on_release_notes.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ name: Publish to PyPi
2121
# See MAINTAINERS.md "Releasing a new version" for release mechanisms
2222

2323
env:
24-
BRANCH: develop
24+
BRANCH: v1
2525

2626
on:
2727
release:
28+
# We can't filter by tag here, so we filter later on the first job
2829
types: [published]
2930
workflow_dispatch:
3031
inputs:
@@ -45,6 +46,7 @@ on:
4546

4647
jobs:
4748
release:
49+
if: ${{ startsWith(github.ref, 'refs/tags/v1') }}
4850
environment: release
4951
runs-on: ubuntu-latest
5052
permissions:
@@ -121,22 +123,8 @@ jobs:
121123
alias: latest
122124
detached_mode: true
123125

124-
post_release:
126+
publish_layer:
125127
needs: release
126-
permissions:
127-
contents: read
128-
issues: write
129-
discussions: write
130-
pull-requests: write
131-
runs-on: ubuntu-latest
132-
env:
133-
RELEASE_VERSION: ${{ needs.release.outputs.RELEASE_VERSION }}
134-
steps:
135-
- uses: actions/checkout@v3
136-
- name: Close issues related to this release
137-
uses: actions/github-script@v6
138-
with:
139-
github-token: ${{ secrets.GITHUB_TOKEN }}
140-
script: |
141-
const post_release = require('.github/scripts/post_release.js')
142-
await post_release({github, context, core})
128+
uses: ./.github/workflows/publish_layer.yml
129+
with:
130+
latest_published_version: ${{ needs.release.outputs.RELEASE_VERSION }}

.github/workflows/publish_layer.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ on:
1111
description: "Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0"
1212
default: "v1.22.0"
1313
required: true
14-
workflow_run:
15-
workflows: ["Publish to PyPi"]
16-
types:
17-
- completed
14+
workflow_call:
15+
inputs:
16+
latest_published_version:
17+
type: string
18+
description: "Latest PyPi published version to rebuild latest docs for, e.g. v1.22.0"
19+
required: true
1820

1921
jobs:
2022
build-layer:
2123
runs-on: ubuntu-latest
22-
if: ${{ (github.event.workflow_run.conclusion == 'success') || (github.event_name == 'workflow_dispatch') }}
2324
defaults:
2425
run:
2526
working-directory: ./layer
@@ -50,13 +51,13 @@ jobs:
5051
RELEASE_INPUT=${{ inputs.latest_published_version }}
5152
LATEST_TAG=$(git describe --tag --abbrev=0)
5253
RELEASE_TAG_VERSION=${RELEASE_INPUT:-$LATEST_TAG}
53-
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> $GITHUB_ENV
54+
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION:1}" >> "$GITHUB_ENV"
5455
- name: install cdk and deps
5556
run: |
5657
npm install -g [email protected]
5758
cdk --version
5859
- name: CDK build
59-
run: cdk synth --context version=$RELEASE_TAG_VERSION -o cdk.out
60+
run: cdk synth --context version="$RELEASE_TAG_VERSION" -o cdk.out
6061
- name: zip output
6162
run: zip -r cdk.out.zip cdk.out
6263
- name: Archive CDK artifacts
@@ -66,8 +67,7 @@ jobs:
6667
path: layer/cdk.out.zip
6768

6869
deploy-beta:
69-
needs:
70-
- build-layer
70+
needs: build-layer
7171
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
7272
secrets: inherit
7373
with:
@@ -76,8 +76,7 @@ jobs:
7676
environment: "layer-beta"
7777

7878
deploy-prod:
79-
needs:
80-
- deploy-beta
79+
needs: deploy-beta
8180
uses: ./.github/workflows/reusable_deploy_layer_stack.yml
8281
secrets: inherit
8382
with:

.github/workflows/publish_v2_layer.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/python_build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ on:
99
- "poetry.lock"
1010
- "mypy.ini"
1111
branches:
12-
- develop
13-
- v2
12+
- v1
1413
push:
1514
paths:
1615
- "aws_lambda_powertools/**"
@@ -19,8 +18,7 @@ on:
1918
- "poetry.lock"
2019
- "mypy.ini"
2120
branches:
22-
- develop
23-
- v2
21+
- v1
2422

2523
jobs:
2624
build:

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/reusable_deploy_v2_sar.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/reusable_publish_changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions:
77
contents: write
88

99
env:
10-
BRANCH: develop
10+
BRANCH: v1
1111

1212
jobs:
1313
publish_changelog:

.github/workflows/reusable_publish_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Reusable publish documentation
22

33
env:
4-
BRANCH: develop
4+
BRANCH: v1
55
ORIGIN: awslabs/aws-lambda-powertools-python
66

77
on:

.github/workflows/run-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55

66
push:
7-
branches: [develop, v2]
7+
branches: [v1]
88
paths:
99
- "aws_lambda_powertools/**"
1010
- "tests/e2e/**"

.github/workflows/v2_on_push_docs.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/v2_rebuild_latest_docs.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ repos:
4040
- id: cfn-python-lint
4141
files: examples/.*\.(yaml|yml)$
4242
- repo: https://github.com/rhysd/actionlint
43-
rev: v1.6.16
43+
rev: v1.6.21
4444
hooks:
4545
- id: actionlint-docker
4646
args: [-pyflakes=]

0 commit comments

Comments
 (0)