Skip to content

Commit 4aee9ab

Browse files
Merge pull request #72 from contentstack/development
DX | 01-04-2025 | Release
2 parents 6c14494 + 0d66ac5 commit 4aee9ab

File tree

3 files changed

+45
-23
lines changed

3 files changed

+45
-23
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,65 @@ 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+
- name: Setup Node.js
16+
uses: actions/setup-node@v4
1317
with:
1418
node-version: "22.x"
15-
- run: npm install
1619

17-
- name: get-package-details
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Get package details
1824
id: package
1925
uses: codex-team/action-nodejs-package-info@v1.1
20-
- name: install npm packall
26+
27+
- name: Install npm-pack-all
2128
run: npm install npm-pack-all
2229

23-
- run: node node_modules/.bin/npm-pack-all
24-
- uses: Klemensas/action-autotag@stable
30+
- name: Pack the npm package
31+
run: node node_modules/.bin/npm-pack-all
32+
33+
# Publish package to npm
34+
- name: Publish to npm
35+
id: publish_npm
36+
uses: JS-DevTools/npm-publish@v3
37+
with:
38+
token: ${{ secrets.NPM_TOKEN }}
39+
# access: public # Uncomment this line if you want to publish the package as public for first time
40+
41+
# Auto-tag new version
42+
- name: Auto-tag new version
2543
id: update_tag
44+
uses: Klemensas/action-autotag@stable
2645
with:
27-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2847
tag_prefix: "v"
29-
- name: Create Release
30-
if: steps.update_tag.outputs.tagname
31-
uses: actions/create-release@v4
48+
49+
# Create GitHub Release
50+
- name: Create GitHub Release
51+
if: steps.update_tag.outputs.tagname != ''
52+
uses: actions/create-release@v1
3253
id: create_release
3354
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3556
with:
3657
tag_name: ${{ steps.update_tag.outputs.tagname }}
3758
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
59+
draft: false
60+
prerelease: false
61+
62+
# Upload release asset
4063
- name: Upload Release Asset
41-
if: steps.update_tag.outputs.tagname
42-
id: upload-release-asset
43-
uses: actions/upload-release-asset@v4
64+
if: steps.update_tag.outputs.tagname != ''
65+
uses: actions/upload-release-asset@v1
4466
env:
4567
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4668
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
69+
upload_url: ${{ steps.create_release.outputs.upload_url }}
70+
asset_path: "./contentstack-datasync-filesystem-sdk-${{ steps.package.outputs.version }}.tgz"
71+
asset_name: "contentstack-datasync-filesystem-sdk-${{ steps.package.outputs.version }}.tgz"
5072
asset_content_type: application/tgz

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "datasync-filesystem-sdk",
2+
"name": "@contentstack/datasync-filesystem-sdk",
33
"version": "1.0.16",
44
"description": "JavaScript filesystem SDK to query data synced via @contentstack/datasync-content-store-filesystem",
55
"main": "dist/index.js",

0 commit comments

Comments
 (0)