Skip to content

Commit 8796e4e

Browse files
ci: add GitHub Actions workflows for SDK npm package deprecate/undeprecate
1 parent 36fd455 commit 8796e4e

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: SDK - Deprecate NPM Package
2+
description: Deprecate a version of @iexec/dataprotector
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
package_version:
8+
description: 'Package version to deprecate (e.g., 1.0.0)'
9+
required: true
10+
type: string
11+
12+
jobs:
13+
deprecate-package:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
registry-url: 'https://registry.npmjs.org'
24+
25+
- name: Authenticate to npm
26+
run: |
27+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
28+
29+
- name: Deprecate package
30+
working-directory: packages/sdk
31+
run: |
32+
if [ -n "${{ github.event.inputs.package_version }}" ]; then
33+
npm deprecate @iexec/dataprotector@${{ github.event.inputs.package_version }} "deprecate ${{ github.event.inputs.package_version }}"
34+
else
35+
echo "Package version is not set"
36+
exit 1
37+
fi
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: SDK - Undeprecate NPM Package
2+
description: Remove deprecation from a version of @iexec/dataprotector
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
package_version:
8+
description: 'Package version to undeprecate (e.g., 1.0.0)'
9+
required: true
10+
type: string
11+
12+
jobs:
13+
undeprecate-package:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '18'
23+
registry-url: 'https://registry.npmjs.org'
24+
25+
- name: Authenticate to npm
26+
run: |
27+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
28+
29+
- name: Undeprecate package
30+
working-directory: packages/sdk
31+
run: |
32+
if [ -n "${{ github.event.inputs.package_version }}" ]; then
33+
npm deprecate @iexec/dataprotector@${{ github.event.inputs.package_version }} ""
34+
else
35+
echo "Package version is not set"
36+
exit 1
37+
fi

0 commit comments

Comments
 (0)