forked from KILTprotocol/sdk-js
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.75 KB
/
devpackpublish.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
name: Publish dev package to npm
on:
push:
branches:
- develop
paths:
- '**/*.ts'
- 'package.json'
- '**/package.json'
- '!**/*.spec.ts'
- '!**/__integrationtests__'
- '!**/__mocks__'
- '!docs/**'
jobs:
build:
runs-on: ubuntu-latest
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && github.repository == 'kiltprotocol/sdk-js'"
steps:
- uses: actions/checkout@v2
with:
# fetch-depth 0 and token needed to push changes on the package.json files back.
fetch-depth: 0
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: 14
- name: Install dependencies
run: yarn install --immutable
- name: Bump prerelease version of root package
run: npm version --no-git-tag-version prerelease
- name: Get current package version
id: package_version
run: echo "::set-output name=package_version::$(node -pe "require('./package.json').version")"
- name: Set all other packages to same version
env:
PACKAGE_VERSION: ${{ steps.package_version.outputs.package_version }}
run: yarn set:version $PACKAGE_VERSION --allow-same-version
- name: Build packages
run: yarn run build
- name: Bundle library
run: yarn run bundle
- name: Publish to npm
run: yarn run publish --tag dev
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.npm_token }}
- name: Commit files
run: |
git config --local user.name "Github Action"
git config --local user.email "[email protected]"
git add .
git commit -m "[CI Skip] ci: publish prerelease" -n
git push