Skip to content

Commit 6756d6c

Browse files
authored
Merge pull request #63 from contentstack/staging
Merge staging to main
2 parents 5ca30f0 + 7d94031 commit 6756d6c

File tree

4 files changed

+455
-445
lines changed

4 files changed

+455
-445
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,54 @@ jobs:
1414
node-version: "18.x"
1515
- run: npm install
1616

17-
- name: get-npm-version
18-
id: package-version
19-
uses: martinbeentjes/npm-get-version-action@v1.3.1
2017
- name: install npm packall
2118
run: npm install npm-pack-all
2219

2320
- run: node node_modules/.bin/npm-pack-all
24-
- uses: Klemensas/action-autotag@stable
25-
id: update_tag
21+
# The below action will see the existing tags and will bump the current ones and this is only used to check whether the given tag already exists or not
22+
# We will be using the previous tag to compare with the current tag in the package.json
23+
# If both match then no new release would be triggered
24+
# Else New release will be created
25+
- name: Bump version and push tag
26+
id: tag_version
27+
uses: mathieudutour/github-tag-action@v6.1
2628
with:
27-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
28-
tag_prefix: "v"
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
default_bump: false
31+
# Getting the version info from package.json
32+
- name: get-npm-version
33+
id: package-version
34+
uses: martinbeentjes/npm-get-version-action@v1.3.1
35+
# Here we are checking whether this is the first release or not and then checking if it is release or not
36+
- name: check-first-release
37+
env:
38+
First_Release: ${{steps.tag_version.outputs.previous_tag=='v0.0.0'}}
39+
run: |
40+
if ${First_Release} == true; then
41+
echo "fr=true" >> $GITHUB_ENV
42+
echo "flag set to true"
43+
else
44+
echo "fr=false" >> $GITHUB_ENV
45+
echo "flag set to false"
46+
fi
47+
- name: check-release-version
48+
if: ${{env.fr=='false'}}
49+
env:
50+
old_version: ${{steps.tag_version.outputs.previous_tag}}
51+
new_version: v${{steps.package-version.outputs.current-version}}
52+
run: |
53+
echo ${old_version}
54+
echo ${new_version}
55+
echo ${{env.old_version==env.new_version}}
56+
if ${{env.old_version!=env.new_version}}; then
57+
echo "fr=true" >> $GITHUB_ENV
58+
echo "flag set to true"
59+
else
60+
echo "fr=false" >> $GITHUB_ENV
61+
echo "flag set to false"
62+
fi
2963
- name: github-release
30-
if: steps.update_tag.outputs.tagname
64+
if: ${{env.fr=='true'}}
3165
id: github-release
3266
env:
3367
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

oclif.manifest.json

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)