-
Notifications
You must be signed in to change notification settings - Fork 19
93 lines (81 loc) · 2.42 KB
/
release.yml
File metadata and controls
93 lines (81 loc) · 2.42 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Release
on:
workflow_dispatch:
inputs:
bump:
description: 'Version bump type'
required: true
type: choice
options:
- patch
- minor
- major
default: patch
prerelease:
description: 'Pre-release'
required: false
type: boolean
default: false
dryrun:
description: 'Dry-run'
required: false
type: boolean
default: false
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create release branch
run: |
BRANCH="chore/release-$(date +%Y-%m-%d_%H:%M:%S)""
echo "RELEASE_BRANCH=$BRANCH" >> $GITHUB_ENV
git checkout -b "$BRANCH"
- name: Install dependencies
run: yarn install --immutable
- name: Build dependencies
run: |
yarn build:core
yarn build:table
yarn build:heuristic-table
yarn build:iframe
- name: Determine bump type
id: bump
run: |
BUMP="${{ inputs.bump }}"
if [ "${{ inputs.prerelease }}" == "true" ]; then
BUMP="pre${{ inputs.bump }} --preid alpha --dist-tag alpha"
fi
if [ "${{ inputs.dryrun }}" == "true" ]; then
BUMP="$BUMP --dry-run"
fi
echo "$BUMP" >> $GITHUB_OUTPUT
- name: Release
run: yarn release ${{ steps.bump.outputs.type }} --yes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create pull request
run: |
gh pr create \
--title "chore: release-$(date +%Y-%m-%d_%H:%M:%S)"" \
--body "chore: this PR contains the changes from the release workflow: version bumps, changelog updates, and README synchronization." \
--base main \
--head "$RELEASE_BRANCH"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}