-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-release.js
28 lines (26 loc) · 848 Bytes
/
get-release.js
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
import { map } from '@dword-design/functions'
import packageName from 'depcheck-package-name'
import parsePackagejsonName from 'parse-packagejson-name'
const ci = `dw-${parsePackagejsonName(packageName`@dword-design/ci`).fullName}`
export default config => [
{
env: {
GITHUB_REPOSITORY: '${{ secrets.GITHUB_REPOSITORY }}',
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}',
},
name: 'Push changed files',
run: `yarn ${ci} push-changed-files`,
},
...([
...config.preDeploySteps,
{
env: {
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}',
...(config.npmPublish ? { NPM_TOKEN: '${{ secrets.NPM_TOKEN }}' } : {}),
...config.deployEnv,
},
name: 'Release',
run: 'yarn semantic-release',
},
] |> map(step => ({ if: "github.ref == 'refs/heads/master'", ...step }))),
]