-
Notifications
You must be signed in to change notification settings - Fork 1.7k
67 lines (66 loc) · 2.06 KB
/
call-increment-version.yml
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
name: Increment Version
on:
workflow_call:
inputs:
increment:
required: true
type: string
dry-run:
required: true
type: boolean
channel:
required: true
type: string
git-repo:
required: true
type: string
secrets:
SSH_KEY:
required: true
outputs:
version:
description: 'The new package.json version, e.g. "0.16.0"'
value: ${{ jobs.release.outputs.version }}
tag-ref:
description: 'The fully qualified ref for the tag, e.g. "refs/tags/v0.16.0"'
value: ${{ jobs.release.outputs.tag-ref }}
latest-release:
description: 'The latest release (per GitHub releases) prior to this increment, e.g. "v0.15.0"'
value: ${{ jobs.release.outputs.latest-release }}
jobs:
release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.increment-version.outputs.version }}
tag-ref: ${{ steps.increment-version.outputs.tag-ref }}
latest-release: ${{ steps.latest.outputs.release }}
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.SSH_KEY }}
fetch-depth: 0
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: |
git config user.name "Lexical GitHub Actions Bot"
git config user.email "<>"
- id: latest
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: facebook
repo: lexical
excludes: draft
- id: increment-version
run: npm run increment-version
env:
# These are passed in the environment as they are used by
# the postversion script
INCREMENT: ${{ inputs.increment }}
CHANNEL: ${{ inputs.channel }}
LATEST_RELEASE: ${{ steps.latest.outputs.release }}
DRY_RUN: ${{ inputs.dry-run && '1' || '' }}
GIT_REPO: ${{ inputs.git-repo }}