Skip to content

Make Version

Make Version #32

Workflow file for this run

name: Make Version
on:
workflow_dispatch: { }
permissions:
contents: read
jobs:
bump-version:
permissions:
id-token: write
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
RELEASE_VERSION: ${{ steps.set-release-version.outputs.RELEASE_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.ref }}
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
- name: Setup NodeJS
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: "22"
cache: "npm"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
- name: Version
id: bump-version
run: npx lerna version --conventional-commits --force-publish --no-git-tag-version --no-push --no-commit-hooks --yes
- name: Update user agent version
run: |
VERSION=$(cat lerna.json | jq .version -r)
echo -e "// this file is auto generated, do not modify\nexport const PT_VERSION = '$VERSION';" > packages/commons/src/version.ts
- name: Stage changes
run: git add .
- name: Set release version
id: set-release-version
run: |
VERSION=$(cat lerna.json | jq .version -r)
echo RELEASE_VERSION="$VERSION" >> "$GITHUB_OUTPUT"
- name: Create PR
id: create-pr
uses: ./.github/actions/create-pr
with:
temp_branch_prefix: "ci-bump"
pull_request_title: "chore(ci): bump version to ${{ steps.set-release-version.outputs.RELEASE_VERSION }}"
github_token: ${{ secrets.GITHUB_TOKEN }}