Skip to content

Commit fb33e1f

Browse files
msumarisvozza
andauthored
chore: Migrate to shared GitHub Actions (#181)
Co-authored-by: Stefano Vozza <[email protected]>
1 parent 7e68a80 commit fb33e1f

File tree

5 files changed

+25
-524
lines changed

5 files changed

+25
-524
lines changed

.github/actions/create-pr/action.yml

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

.github/actions/create-pr/create_pr_for_staged_changes.sh

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

.github/workflows/make-version.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
name: Make Version
22

33
on:
4-
workflow_dispatch: { }
4+
workflow_dispatch:
5+
inputs:
6+
release-type:
7+
description: "Release type (major, minor, patch)"
8+
required: false
9+
type: choice
10+
options:
11+
- major
12+
- minor
13+
- patch
514

615
permissions:
716
contents: read
817

9-
1018
jobs:
1119
bump-version:
1220
permissions:
@@ -18,7 +26,7 @@ jobs:
1826
RELEASE_VERSION: ${{ steps.set-release-version.outputs.RELEASE_VERSION }}
1927
steps:
2028
- name: Checkout code
21-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2230
with:
2331
ref: ${{ github.ref }}
2432
fetch-depth: 0 # fetch all history, commits and tags, lerna scans it to the last tag and looks at commits, we need all of it to determine the next version
@@ -28,16 +36,18 @@ jobs:
2836
node-version: "22"
2937
cache: "npm"
3038
- name: Setup dependencies
31-
uses: aws-powertools/actions/.github/actions/cached-node-modules@743fa57a003787b157991ea5c6e3cf0d40468676
32-
- name: Version
33-
id: bump-version
34-
run: npx changelogen --bump --no-commit --no-push --noAuthors
35-
- name: Update version in lock file
36-
run: npm update --package-lock-only
39+
uses: aws-powertools/actions/.github/actions/cached-node-modules@743fa57a003787b157991ea5c6e3cf0d40468676 # v1.4.0
40+
with:
41+
node-version: ${{ env.NODE_VERSION }}
42+
build: "false"
43+
- name: Version and changelog
44+
id: version-n-changelog
45+
uses: aws-powertools/actions/.github/actions/version-n-changelog@743fa57a003787b157991ea5c6e3cf0d40468676 # v1.4.0
46+
with:
47+
release-type: ${{ github.event.inputs.release-type }}
3748
- name: Update user agent version
3849
run: |
39-
VERSION=$(cat package.json | jq .version -r)
40-
echo -e "// this file is auto generated, do not modify\nexport const VERSION = '$VERSION';" > src/version.ts
50+
echo -e "// this file is auto generated, do not modify\nexport const VERSION = '${{ steps.version-n-changelog.outputs.new-version }}';" > src/version.ts
4151
- name: Stage changes
4252
run: git add .
4353
- name: Set release version
@@ -47,8 +57,8 @@ jobs:
4757
echo RELEASE_VERSION="$VERSION" >> "$GITHUB_OUTPUT"
4858
- name: Create PR
4959
id: create-pr
50-
uses: ./.github/actions/create-pr
60+
uses: aws-powertools/actions/.github/actions/create-pr@743fa57a003787b157991ea5c6e3cf0d40468676 # v1.4.0
5161
with:
5262
temp_branch_prefix: "ci-bump"
5363
pull_request_title: "chore: bump version to ${{ steps.set-release-version.outputs.RELEASE_VERSION }}"
54-
github_token: ${{ secrets.GITHUB_TOKEN }}
64+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)