Skip to content

Commit 2d013bd

Browse files
committed
[ci] add github release
1 parent ec45fcb commit 2d013bd

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/cicd.yaml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,26 @@ jobs:
1212
yarn
1313
yarn run build
1414
yarn run codegen
15+
- id: version
16+
if: startsWith(github.ref, 'refs/tags/v')
17+
run: echo "::set-output name=version::${GITHUB_REF##refs/tags/v}"
1518
- name: Publish NPM package
1619
if: startsWith(github.ref, 'refs/tags/v')
1720
env:
1821
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
1922
run: |
20-
npm version --no-git-tag-version "${GITHUB_REF##refs/tags/}"
21-
echo "$NPM_TOKEN" > .npmrc
23+
npm version --no-git-tag-version "${{steps.version.outputs.version}}"
24+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
2225
npm publish --access public
2326
rm .npmrc
27+
- name: Github Release
28+
if: startsWith(github.ref, 'refs/tags/v')
29+
uses: actions/create-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
32+
with:
33+
tag_name: v${{steps.version.outputs.version}}
34+
release_name: v${{steps.version.outputs.version}}
35+
body: |
36+
## NPM Package
37+
https://www.npmjs.com/package/graphql-codegen-golang/v/$${{steps.version.outputs.version}}

0 commit comments

Comments
 (0)