Skip to content

Commit 04b5254

Browse files
Merge pull request #50 from contentstack/development
DX | 06-02-2025 | Release
2 parents eb25d05 + 2cedb2f commit 04b5254

24 files changed

+712
-797
lines changed

.github/workflows/node.js.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [master, development]
9+
pull_request:
10+
branches: [master, development]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [18.x, 20.x]
19+
20+
steps:
21+
- uses: actions/checkout@v3.5.3
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3.7.0
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: npm ci
27+
- run: npm test
28+
env:
29+
TOKEN: ${{secrets.TOKEN}}
30+
TOKEN_WITH_NO_CT: ${{secrets.TOKEN_WITH_NO_CT}}
31+
APIKEY: ${{secrets.APIKEY}}
32+
APIKEY_WITH_NO_CT: ${{secrets.APIKEY_WITH_NO_CT}}
33+
ENVIRONMENT: ${{secrets.ENVIRONMENT}}
34+
REGION: ${{secrets.REGION}}
35+
TOKENTYPE: ${{secrets.TOKENTYPE}}
36+
BRANCH: ${{secrets.BRANCH}}

.github/workflows/npm-publish-github-packages.yml

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

.github/workflows/npm-publish.yml

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

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish package to NPM and Git registry
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build and upload
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3.5.3
15+
with:
16+
fetch-depth: 0
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v3.7.0
19+
with:
20+
node-version: "18.x"
21+
- name: Install dependencies
22+
run: npm install
23+
- name: Build
24+
run: |
25+
rm -rf dist
26+
npm run prepare
27+
- name: Upload dist
28+
uses: actions/upload-artifact@v3.1.2
29+
with:
30+
name: dist
31+
path: dist
32+
33+
release:
34+
name: Download dist and release
35+
runs-on: ubuntu-latest
36+
needs: build
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v3.5.3
40+
with:
41+
fetch-depth: 0
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v3.7.0
44+
with:
45+
node-version: "18.x"
46+
- name: Install dependencies
47+
run: npm install
48+
- name: Download dist
49+
uses: actions/download-artifact@v3
50+
with:
51+
name: dist
52+
path: dist
53+
- name: Display dirs
54+
run: ls -R
55+
- uses: Klemensas/action-autotag@1.2.3
56+
id: update_tag
57+
with:
58+
GITHUB_TOKEN: "${{ secrets.PKG_TOKEN }}"
59+
tag_prefix: "v"
60+
- name: Release
61+
if: steps.update_tag.outputs.tagname
62+
id: release-plugin
63+
uses: JS-DevTools/npm-publish@v2.2.0
64+
with:
65+
token: ${{ secrets.TYPES_GENERATOR_AUTOMATION }}
66+
strategy: upgrade
67+
- name: GitHub Release
68+
if: steps.update_tag.outputs.tagname
69+
id: github-release
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.PKG_TOKEN }}
72+
run: gh release create v${{ steps.release-plugin.outputs.version }} --title "Release ${{ steps.release-plugin.outputs.version }}" --generate-notes

0 commit comments

Comments
 (0)