-
Notifications
You must be signed in to change notification settings - Fork 222
64 lines (50 loc) · 2.01 KB
/
publish_branch.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
name: Deploy Branch
on: workflow_dispatch
jobs:
deploy:
runs-on: ubuntu-20.04
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
BROWSERSLIST_IGNORE_OLD_DATA: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Get dist-tag from branch name
env:
BRANCH: ${{ github.ref_name }}
id: split
run: echo "branchDescription=${BRANCH##*/}" >> "$GITHUB_OUTPUT"
- name: Fail if no proper branch name
run: |
if test -z "${{ steps.split.outputs.branchDescription }}"; then
echo "Failed as no proper branch name was provided. Please use the format of prefix/branch-description."
exit 1
fi
- name: pnpm cache
uses: actions/cache@v3
with:
path: ./common/temp/pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Rush Install
run: node common/scripts/install-run-rush.js install
- name: Setup git
uses: oleksiyrudenko/[email protected]
with:
token: '${{ secrets.GITHUB_TOKEN }}'
name: github-actions[bot]
email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Rush Version
run: node common/scripts/install-run-rush.js version --bump --ignore-git-hooks --override-prerelease-id dev --override-bump prerelease
- name: Rush Build
run: node common/scripts/install-run-rush.js rebuild --verbose
- name: Rush Test
run: node common/scripts/install-run-rush.js test --verbose
- name: Rush Publish
env:
BRANCH_DESCRIPTION: ${{ steps.split.outputs.branchDescription }}
run: node common/scripts/install-run-rush.js publish --apply --include-all --publish --tag $BRANCH_DESCRIPTION --set-access-level public --ignore-git-hooks