Skip to content

Commit e55cd29

Browse files
Merge pull request #57 from contentstack/development
DX | 01-04-2025 | Release
2 parents 6da6255 + d0afcf5 commit e55cd29

File tree

3 files changed

+51
-24
lines changed

3 files changed

+51
-24
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,70 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v4
11+
# Checkout the repository
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
# Setup Node.js environment
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
1318
with:
1419
node-version: "22.x"
15-
- run: npm install
1620

17-
- name: get-package-details
21+
# Install dependencies
22+
- name: Install dependencies
23+
run: npm install
24+
25+
# Fetch package details (name and version)
26+
- name: Get package details
1827
id: package
1928
uses: codex-team/[email protected]
20-
- name: install npm packall
29+
30+
# Install npm-pack-all to create a package archive
31+
- name: Install npm-pack-all
2132
run: npm install npm-pack-all
2233

23-
- run: node node_modules/.bin/npm-pack-all
24-
- uses: Klemensas/action-autotag@stable
34+
# Pack the package into a .tgz archive
35+
- name: Pack the npm package
36+
run: node node_modules/.bin/npm-pack-all
37+
38+
# Publish the package to npm
39+
- name: Publish to npm
40+
id: publish_npm
41+
uses: JS-DevTools/npm-publish@v3
42+
with:
43+
token: ${{ secrets.NPM_TOKEN }}
44+
# access: public # Uncomment this line if you want to publish the package as public for first time
45+
46+
# Auto-tag the new version if a change is detected
47+
- name: Auto-tag new version
2548
id: update_tag
49+
uses: Klemensas/action-autotag@stable
2650
with:
2751
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2852
tag_prefix: "v"
29-
- name: Create Release
30-
if: steps.update_tag.outputs.tagname
53+
54+
# Create a new GitHub Release
55+
- name: Create GitHub Release
56+
if: steps.update_tag.outputs.tagname != ''
3157
uses: actions/create-release@v1
3258
id: create_release
3359
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3561
with:
3662
tag_name: ${{ steps.update_tag.outputs.tagname }}
3763
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
64+
draft: false
65+
prerelease: false
66+
67+
# Upload the packaged .tgz file as a release asset
4068
- name: Upload Release Asset
41-
if: steps.update_tag.outputs.tagname
42-
id: upload-release-asset
69+
if: steps.update_tag.outputs.tagname != ''
4370
uses: actions/upload-release-asset@v1
4471
env:
4572
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4673
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: ./${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.tgz
49-
asset_name: ${{ steps.package.outputs.name }}-${{ steps.package.outputs.version }}.tgz
50-
asset_content_type: application/tgz
74+
upload_url: ${{ steps.create_release.outputs.upload_url }}
75+
asset_path: "./contentstack-datasync-mongodb-sdk-${{ steps.package.outputs.version }}.tgz"
76+
asset_name: "contentstack-datasync-mongodb-sdk-${{ steps.package.outputs.version }}.tgz"
77+
asset_content_type: application/tgz

package-lock.json

Lines changed: 4 additions & 4 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"author": "Contentstack Ecosystem <[email protected]>",
3-
"name": "datasync-mongodb-sdk",
4-
"version": "1.0.9",
3+
"name": "@contentstack/datasync-mongodb-sdk",
4+
"version": "1.0.10",
55
"description": "Mongodb query wrapper around contents synced via @contentstack/content-store-mongodb",
66
"main": "dist/index.js",
77
"scripts": {

0 commit comments

Comments
 (0)