-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (113 loc) · 3.51 KB
/
workflow.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Test, Build and Publish.
on: [push]
jobs:
test:
strategy:
matrix:
version: [18, 20]
permissions:
packages: read
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: |
echo @92green:https://npm.pkg.github.com/ > ${GITHUB_WORKSPACE:-~}/.npmrc
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ${GITHUB_WORKSPACE:-~}/.npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: NPM Install
run: npm install
env:
NPM_CONFIG_USERCONFIG: $GITHUB_WORKSPACE/.npmrc
NODE_ENV: "development"
- name: test
run: npm run test
env:
NODE_ENV: "development"
publish_pre_release:
needs: test
if: contains(github.ref, 'refs/heads/release')
strategy:
matrix:
version: [18]
permissions:
packages: write
id-token: write
contents: write
concurrency:
# pushes to same branch, to cancel out old actions
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.version }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: |
echo @92green:https://npm.pkg.github.com/ > ${GITHUB_WORKSPACE:-~}/.npmrc
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ${GITHUB_WORKSPACE:-~}/.npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: NPM Install
run: npm install
env:
NPM_CONFIG_USERCONFIG: $GITHUB_WORKSPACE/.npmrc
NODE_ENV: "development"
- name: Package pre-release
run: npx release-it --preRelease --ci
env:
NODE_ENV: "development"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_release:
needs: test
if: contains(github.ref, 'refs/heads/auto-release')
strategy:
matrix:
version: [18]
permissions:
packages: write
id-token: write
contents: write
concurrency:
# pushes to same branch, to cancel out old actions
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.version }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
- run: |
echo @92green:https://npm.pkg.github.com/ > ${GITHUB_WORKSPACE:-~}/.npmrc
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> ${GITHUB_WORKSPACE:-~}/.npmrc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: NPM Install
run: npm install
env:
NPM_CONFIG_USERCONFIG: $GITHUB_WORKSPACE/.npmrc
NODE_ENV: "development"
- name: Package release
run: npx release-it --ci
env:
NODE_ENV: "development"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}