-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (73 loc) · 2.08 KB
/
release-next.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
68
69
70
71
72
73
74
75
76
on:
workflow_run:
workflows:
- build
types:
- completed
branches:
- next
name: Create Beta Release
jobs:
release:
name: Release beta
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 50
ref: refs/heads/next
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: git fetch --prune --unshallow
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: npm ci
- name: Get latest changelog
id: Changelog
run: |
changelog=$(npm run --silent get-changelog | tail -n +1)
echo $changelog
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo "::set-output name=changelog::$changelog"
- name: Get release version
id: release_type
run: |
RELEASE_VERSION=`cat VERSION`
echo "::set-output name=version::$RELEASE_VERSION"
- name: Create github release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release_type.outputs.version }}
release_name: Release ${{ steps.release_type.outputs.version }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: true
publish-npm:
name: Publish to npm
runs-on: ubuntu-latest
needs: release
steps:
- uses: actions/checkout@v2
with:
ref: refs/heads/next
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build --if-present
- name: Publish
run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}