-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 2.22 KB
/
release.yml
File metadata and controls
72 lines (63 loc) · 2.22 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
66
67
68
69
70
71
72
name: Create Release
on:
workflow_dispatch:
inputs:
type:
type: choice
description: Release Type
options:
- patch
- minor
- major
jobs:
createRelease:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: tibdex/github-app-token@32691ba7c9e7063bd457bd8f2a5703138591fa58 # v1
id: generate-token
with:
app_id: ${{ secrets.PR_APP_ID }}
private_key: ${{ secrets.PR_APP_PRIVATE_KEY }}
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
name: Checkout repository
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
name: Use Node.js 20.x
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
corepack: true
- name: Install dependencies
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3
with:
retry_on: error
timeout_minutes: 5
max_attempts: 2
command: yarn
- name: Bump version
id: bump-version
run: |
gh auth status
gh auth setup-git
git config --global user.name "fragment-pr-bot[bot]"
git config --global user.email "228685+fragment-pr-bot[bot]@users.noreply.github.com"
echo "Creating NPM release ${{ inputs.type }}"
npm version ${{ inputs.type }}
yarn build
echo "version=$(npm pkg get version | tr -d '\"')"
echo "version=$(npm pkg get version | tr -d '\"')" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v4
with:
token: ${{ steps.generate-token.outputs.token }}
title: Bump SDK version (${{ steps.bump-version.outputs.version }})
branch: create-pull-request/${{ inputs.type }}-${{ steps.bump-version.outputs.version }}
base: 'dev'
body: >
This PR is auto-generated by github action.