Skip to content

Commit 80d8feb

Browse files
committed
add actions
1 parent 7672a8b commit 80d8feb

File tree

4 files changed

+42
-17
lines changed

4 files changed

+42
-17
lines changed

.github/workflows/publish.yml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Publish to NPM
33
on:
44
release:
55
types: [published]
6+
push:
7+
branches:
8+
- graph_workspace
9+
tags:
10+
- '@gravity-ui/[email protected]*'
11+
- '@gravity-ui/[email protected]*'
612

713
jobs:
814
publish:
@@ -22,28 +28,42 @@ jobs:
2228
- name: Determine which package to publish
2329
id: package
2430
run: |
25-
TAG_NAME="${{ github.event.release.tag_name }}"
26-
echo "Tag: $TAG_NAME"
27-
28-
if [[ "$TAG_NAME" == *"@gravity-ui/graph-react"* ]]; then
29-
echo "package=react" >> $GITHUB_OUTPUT
30-
elif [[ "$TAG_NAME" == *"@gravity-ui/graph"* ]]; then
31-
echo "package=graph" >> $GITHUB_OUTPUT
32-
else
33-
echo "Unknown package tag format"
34-
exit 1
31+
if [ "${{ github.event_name }}" = "release" ]; then
32+
TAG_NAME="${{ github.event.release.tag_name }}"
33+
echo "Release tag: $TAG_NAME"
34+
35+
if [[ "$TAG_NAME" == *"@gravity-ui/graph-react"* ]]; then
36+
echo "package=react" >> $GITHUB_OUTPUT
37+
elif [[ "$TAG_NAME" == *"@gravity-ui/graph"* ]]; then
38+
echo "package=graph" >> $GITHUB_OUTPUT
39+
else
40+
echo "Unknown package tag format"
41+
exit 1
42+
fi
43+
elif [ "${{ github.event_name }}" = "push" ]; then
44+
TAG_NAME="${{ github.ref_name }}"
45+
echo "Push tag: $TAG_NAME"
46+
47+
if [[ "$TAG_NAME" == *"@gravity-ui/[email protected]"* ]]; then
48+
echo "package=react" >> $GITHUB_OUTPUT
49+
elif [[ "$TAG_NAME" == *"@gravity-ui/[email protected]"* ]]; then
50+
echo "package=graph" >> $GITHUB_OUTPUT
51+
else
52+
echo "Unknown package tag format"
53+
exit 1
54+
fi
3555
fi
3656
3757
- name: Publish @gravity-ui/graph
3858
if: steps.package.outputs.package == 'graph'
39-
run: npm publish --access public
59+
run: npm publish --access public --tag beta
4060
working-directory: packages/graph
4161
env:
4262
NODE_AUTH_TOKEN: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
4363

4464
- name: Publish @gravity-ui/graph-react
4565
if: steps.package.outputs.package == 'react'
46-
run: npm publish --access public
66+
run: npm publish --access public --tag beta
4767
working-directory: packages/react
4868
env:
4969
NODE_AUTH_TOKEN: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}

.github/workflows/release-please.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: release-please
33
on:
44
push:
55
branches:
6-
- main
6+
- graph_workspace
77

88
permissions:
99
contents: write
@@ -18,4 +18,5 @@ jobs:
1818
token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
1919
config-file: release-please-config.json
2020
manifest-file: .release-please-manifest.json
21+
target-branch: graph_workspace
2122

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"packages/graph": "1.4.0",
3-
"packages/react": "1.4.0"
2+
"packages/graph": "2.0.0-beta.0",
3+
"packages/react": "2.0.0-beta.0"
44
}
55

release-please-config.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
"package-name": "@gravity-ui/graph",
55
"release-type": "node",
66
"changelog-path": "CHANGELOG.md",
7-
"component": "@gravity-ui/graph"
7+
"component": "@gravity-ui/graph",
8+
"prerelease": true,
9+
"prerelease-type": "beta"
810
},
911
"packages/react": {
1012
"package-name": "@gravity-ui/graph-react",
1113
"release-type": "node",
1214
"changelog-path": "CHANGELOG.md",
13-
"component": "@gravity-ui/graph-react"
15+
"component": "@gravity-ui/graph-react",
16+
"prerelease": true,
17+
"prerelease-type": "beta"
1418
}
1519
},
1620
"release-type": "node",

0 commit comments

Comments
 (0)