Skip to content

Commit f33042d

Browse files
Merge pull request #10 from contentstack/feat/CS-37901
feat: added github release workflow
2 parents 879cb61 + 2dec4f0 commit f33042d

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/github-release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: "16.x"
15+
- run: npm install
16+
17+
- name: get-package-details
18+
id: package
19+
uses: codex-team/action-nodejs-package-info@v1.1
20+
- name: install npm packall
21+
run: npm install npm-pack-all
22+
23+
- run: node node_modules/.bin/npm-pack-all
24+
- uses: Klemensas/action-autotag@stable
25+
id: update_tag
26+
with:
27+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
28+
tag_prefix: "v"
29+
- name: Create Release
30+
if: steps.update_tag.outputs.tagname
31+
uses: actions/create-release@v1
32+
id: create_release
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
35+
with:
36+
tag_name: ${{ steps.update_tag.outputs.tagname }}
37+
release_name: Release ${{ steps.update_tag.outputs.tagname }}
38+
draft: false # Default value, but nice to set explicitly
39+
prerelease: false # Default value, but nice to set explicitly
40+
- name: Upload Release Asset
41+
if: steps.update_tag.outputs.tagname
42+
id: upload-release-asset
43+
uses: actions/upload-release-asset@v1
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
48+
asset_path: ./contentstack-webhook-listener-${{ steps.package.outputs.version }}.tgz
49+
asset_name: contentstack-webhook-listener-${{ steps.package.outputs.version }}.tgz
50+
asset_content_type: application/tgz

0 commit comments

Comments
 (0)