-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (64 loc) · 2.32 KB
/
workflow.yml
File metadata and controls
74 lines (64 loc) · 2.32 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
name: TypeScript Library CI/CD
env:
PRERELEASE_BRANCHES: legolas, gimli, sam, meriadoc # Comma separated list of prerelease branch names. 'alpha,rc, ...'
on:
push:
branches:
- '**'
pull_request:
types: [closed]
jobs:
build:
name: Continuous Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node v12
uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: 'https://registry.npmjs.org'
- name: Establish context
id: context
uses: dolittle/establish-context-action@v2
with:
prerelease-branches: ${{ env.PRERELEASE_BRANCHES }}
- name: Increment version
id: increment-version
if: ${{ steps.context.outputs.should-publish == 'true' }}
uses: dolittle/increment-version-action@v2
with:
version: ${{ steps.context.outputs.current-version }}
release-type: ${{ steps.context.outputs.release-type }}
- name: Update VersionInfo
uses: dolittle/update-version-info-action@v1
with:
version: ${{ steps.increment-version.outputs.next-version || '0.0.0-prerelease' }}
files-to-update: Source/sdk/VersionInfo.ts
- run: yarn
- run: yarn ci
- name: Prepend to Changelog
if: ${{ steps.context.outputs.should-publish == 'true' && steps.context.outputs.release-type != 'prerelease' }}
uses: dolittle/add-to-changelog-action@v2
with:
version: ${{ steps.increment-version.outputs.next-version }}
body: ${{ steps.context.outputs.pr-body }}
pr-url: ${{ steps.context.outputs.pr-url }}
changelog-path: CHANGELOG.md
user-email: build@dolittle.com
user-name: dolittle-build
- name: Create GitHub Release
if: ${{ steps.context.outputs.should-publish == 'true' }}
uses: dolittle/github-release-action@v2
with:
token: ${{ secrets.BUILD_PAT }}
version: ${{ steps.increment-version.outputs.next-version }}
body: ${{ steps.context.outputs.pr-body }}
- name: Release JavaScript
if: ${{ steps.context.outputs.should-publish == 'true' }}
uses: dolittle/release-typescript-lib-action@v1
with:
version: ${{ steps.increment-version.outputs.next-version }}
root: '.'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}