-
Notifications
You must be signed in to change notification settings - Fork 192
57 lines (53 loc) · 2.05 KB
/
make-version.yml
File metadata and controls
57 lines (53 loc) · 2.05 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
name: Make Version
on:
workflow_dispatch:
inputs:
release-type:
description: 'Release type (major, minor, patch)'
required: false
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.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@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@da5bcb1a3d22f87bc48b570c818d26f44c0fc960 # v1.3.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@da5bcb1a3d22f87bc48b570c818d26f44c0fc960 # v1.3.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@da5bcb1a3d22f87bc48b570c818d26f44c0fc960 # v1.3.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 }}