Skip to content

Make Version

Make Version #56

Workflow file for this run

name: Make Version
on:
workflow_dispatch:
inputs:
release-type:
description: 'Release type, if auto it will be determined by the changes since the last tag'
required: false
type: choice
options:
- auto
- major
- minor
- patch
permissions:
contents: read
jobs:
bump-version:
permissions:
id-token: write
contents: write
pull-requests: write
runs-on: ubuntu-latest
env:
NODE_VERSION: "22"
outputs:
RELEASE_VERSION: ${{ steps.version-n-changelog.outputs.new-version }}
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.ref }}
fetch-depth: 0 # fetch all history, commits and tags, so we can determine the next version
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@3b5b8e2e58b7af07994be982e83584a94e8c76c5 # v1.5.0
with:
node-version: ${{ env.NODE_VERSION }}
build: "false"
- name: Version and changelog
id: version-n-changelog
uses: aws-powertools/actions/.github/actions/version-n-changelog@3b5b8e2e58b7af07994be982e83584a94e8c76c5 # v1.5.0
with:
release-type: ${{ github.event.inputs.release-type }}
- name: Update user agent version
run: |
echo -e "// this file is auto generated, do not modify\nexport const PT_VERSION = '${{ steps.version-n-changelog.outputs.new-version }}';" > packages/commons/src/version.ts
- name: Stage changes
run: git add .
- name: Create PR
id: create-pr
uses: aws-powertools/actions/.github/actions/create-pr@3b5b8e2e58b7af07994be982e83584a94e8c76c5 # v1.5.0
with:
temp_branch_prefix: "ci-bump"
pull_request_title: "chore(ci): bump version to ${{ steps.version-n-changelog.outputs.new-version }}"
github_token: ${{ secrets.GITHUB_TOKEN }}