-
Notifications
You must be signed in to change notification settings - Fork 34
67 lines (64 loc) · 2.21 KB
/
release.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: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: "Release Version"
required: true
developmentVersion:
description: "Next Development Version"
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: "https://registry.npmjs.org"
- name: Bump to release version
run: |
git config user.name flexrouting+ci
git config user.email flexrouting+ci@twilio.com
yarn version --new-version "${{ github.event.inputs.releaseVersion }}" --no-git-tag-version
- run: |
yarn
yarn build
- run: |
git add .
git add -f dist
git commit -m "${{ github.event.inputs.releaseVersion }}"
git tag ${{ github.event.inputs.releaseVersion }}
git push origin HEAD:main --tags
git checkout -B gh-pages
find . -mindepth 1 -maxdepth 1 \( -name .gitignore -o -name node_modules -o -name dist -o -name .git \) -prune -o -exec rm -rf {} +
mv dist/docs/* .
rm -rf dist
git add .
git commit -am "${{ github.event.inputs.releaseVersion }}"
git push origin gh-pages --force
git checkout main
yarn publish --new-version "${{ github.event.inputs.releaseVersion }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
development:
runs-on: ubuntu-latest
needs: [release]
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Bump version
id: bump_version
run: |
git config user.name flexrouting+ci
git config user.email flexrouting+ci@twilio.com
git pull origin HEAD:main
yarn version --new-version "${{ github.event.inputs.developmentVersion }}" --no-git-tag-version
git pull origin HEAD:main
git add .
git rm -rf dist
git commit -m "${{ github.event.inputs.developmentVersion }}"
git push origin HEAD:main --force