Make Version #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version: "20" | |
cache: "npm" | |
- name: Setup dependencies | |
uses: ./.github/actions/cached-node-modules | |
- name: Version | |
id: bump-version | |
run: npx lerna version --conventional-commits --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 }} |