Skip to content

Commit 06545ae

Browse files
authored
Merge pull request #2 from contentstack/gitWorkflow
Add Release workflow and cli-ux dependency
2 parents 55ceead + 06c8eb5 commit 06545ae

File tree

3 files changed

+69
-45
lines changed

3 files changed

+69
-45
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Releases
2+
3+
on:
4+
push:
5+
branches: [ main ]
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: '12.x'
15+
- run: npm install
16+
17+
- name: get-npm-version
18+
id: package-version
19+
uses: martinbeentjes/npm-get-version-action@master
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-cli-cm-regex-validate-${{ steps.package-version.outputs.current-version }}.tgz
49+
asset_name: contentstack-cli-cm-regex-validate-${{ steps.package-version.outputs.current-version }}.tgz
50+
asset_content_type: application/tgz

package-lock.json

Lines changed: 17 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@contentstack/cli-cm-regex-validate",
33
"description": "Validate Fields with Regex Property of Content Type and Global Field in a Stack",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"author": "Contentstack",
66
"bugs": "https://github.com/contentstack/cli-cm-regex-validate/issues",
77
"devDependencies": {
@@ -67,6 +67,7 @@
6767
"@oclif/command": "^1.8.0",
6868
"@oclif/config": "^1.17.0",
6969
"cli-table3": "^0.6.0",
70+
"cli-ux": "^5.6.3",
7071
"inquirer": "^6.5.2",
7172
"jest": "^27.1.1",
7273
"jsonexport": "^3.2.0",

0 commit comments

Comments
 (0)