-
Notifications
You must be signed in to change notification settings - Fork 192
65 lines (61 loc) · 2.25 KB
/
make-version.yml
File metadata and controls
65 lines (61 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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: "24"
outputs:
RELEASE_VERSION: ${{ steps.version-n-changelog.outputs.new-version }}
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
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@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.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: ${{ env.RELEASE_TYPE }}
env:
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 }}