Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/publish-npm-sdk-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: npm publish latest - dataprotector
description: Publish on npm when a release is published

on:
release:
types: [published]

jobs:
publish-npm:
# check tag is "sdk-v*"
if: contains(github.ref_name,'sdk-v')
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
scope: '@iexec/dataprotector-sdk'
registry: 'https://registry.npmjs.org'
node-version: '18'
working-directory: packages/sdk
tag: 'latest'
install-command: |
npm ci
npm run codegen
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
name: Publish Package NPM - dataprotector
name: npm publish staging - dataprotector
description: Publish a staging version on npm

on:
workflow_dispatch:
inputs:
tag:
description: 'NPM tag to publish (latest or nightly)'
required: true
type: choice
options:
- latest
- nightly
- beta
default: nightly

jobs:
set-publish-version:
Expand All @@ -25,31 +16,26 @@ jobs:
uses: actions/setup-node@v4
- name: Set publish version
id: set-publish-version
if: github.event.inputs.tag == 'nightly'
working-directory: packages/sdk
run: |
if [ "${{ github.event.inputs.tag }}" == "nightly" ]; then
CURRENT_VERSION=$(npm pkg get version | tr -d '"')
NIGHTLY_VERSION="${CURRENT_VERSION}-nightly-${GITHUB_SHA::7}"
echo "VERSION=${NIGHTLY_VERSION}" >> $GITHUB_OUTPUT
else
echo "VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT
fi
CURRENT_VERSION=$(npm pkg get version | tr -d '"')
NIGHTLY_VERSION="${CURRENT_VERSION}-nightly-${GITHUB_SHA::7}"
echo "VERSION=${NIGHTLY_VERSION}" >> $GITHUB_OUTPUT
outputs:
VERSION: ${{ steps.set-publish-version.outputs.VERSION }}

publish-npm:
# Run only on main branch
if: github.ref == 'refs/heads/main'
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.4.0
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.5.0
needs: set-publish-version
with:
scope: '@iexec/dataprotector-sdk'
registry: 'https://registry.npmjs.org'
node-version: '18'
environment: ${{ github.event.inputs.target }}
environment: 'staging'
working-directory: packages/sdk
tag: ${{ github.event.inputs.tag }}
tag: 'nightly'
version: ${{ needs.set-publish-version.outputs.VERSION }}
install-command: |
npm ci
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: release-please
description: triggers release-please to open the next release PR

on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release-please:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
secrets: inherit
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"packages/sdk": "2.0.0-beta.16"
}
36 changes: 36 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": false,
"changelog-sections": [
{ "type": "feat", "section": "Added", "hidden": false },

{ "type": "fix", "section": "Changed", "hidden": false },
{ "type": "change", "section": "Changed", "hidden": false },
{ "type": "deprecate", "section": "Changed", "hidden": false },
{ "type": "revert", "section": "Changed", "hidden": false },
{ "type": "security", "section": "Changed", "hidden": false },
{ "type": "perf", "section": "Changed", "hidden": false },
{ "type": "refactor", "section": "Changed", "hidden": false },

{ "type": "remove", "section": "Removed", "hidden": false },

{ "type": "style", "section": "Misc", "hidden": true },
{ "type": "build", "section": "Misc", "hidden": true },
{ "type": "chore", "section": "Misc", "hidden": true },
{ "type": "test", "section": "Misc", "hidden": true },
{ "type": "deps", "section": "Misc", "hidden": true },
{ "type": "ci", "section": "Misc", "hidden": true },
{ "type": "docs", "section": "Misc", "hidden": true }
],
"packages": {
"packages/sdk": {
"release-type": "node",
"changelog-path": "CHANGELOG.md",
"include-v-in-tag": true,

"prerelease": true,
"prerelease-type": "beta",
"versioning": "prerelease"
}
}
}