-
Notifications
You must be signed in to change notification settings - Fork 13
66 lines (60 loc) · 2.4 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
name: Bump And Publish
on:
workflow_dispatch:
inputs:
yarnVersionArgs:
description: 'Arguments for "yarn version"'
required: true
default: "patch"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 20
- run: yarn
- run: yarn build
- run: yarn test
- name: Setup GIT
run: |
git reset --hard
git config --local --list
git checkout master
git config user.email "$GH_EMAIL"
git config user.name "$GH_USER"
env:
GH_EMAIL: ${{secrets.GH_EMAIL}}
GH_USER: ${{secrets.GH_USER}}
- name: Bump version
run: |
git reset --hard
yarn workspace repluggable-core version ${{ github.event.inputs.yarnVersionArgs }}
yarn workspace repluggable version ${{ github.event.inputs.yarnVersionArgs }}
export NEW_CORE_RELEASE_VERSION=$(npm pkg get version --workspace=repluggable-core | jq -r '."repluggable-core"')
export NEW_REPLUGGABLE_RELEASE_VERSION=$(npm pkg get version --workspace=repluggable | jq -r '."repluggable"')
echo repluggable-core New Release Version is: [$NEW_CORE_RELEASE_VERSION]
echo repluggable New Release Version is: [$NEW_REPLUGGABLE_RELEASE_VERSION]
yarn workspace repluggable add repluggable-core@$NEW_CORE_RELEASE_VERSION
yarn build
yarn test
git add . || true
git commit -m "Release v$NEW_REPLUGGABLE_RELEASE_VERSION" || true
git tag -a "v$NEW_REPLUGGABLE_RELEASE_VERSION" -m "Release v$NEW_REPLUGGABLE_RELEASE_VERSION"
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY"
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY" --tags
echo "::notice::repluggable-core@NEW_CORE_RELEASE_VERSION"
echo "::notice::repluggable@NEW_REPLUGGABLE_RELEASE_VERSION"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: npm publish repluggable-core
run: |
npm publish --workspace repluggable-core
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
- name: npm publish repluggable
run: |
npm publish --workspace repluggable
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}