Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: release pipeline #8

Merged
merged 25 commits into from
Oct 31, 2023
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: CI
name: 'ci'

on:
workflow_call:
push:
branches:
- main
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/release_sdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 'Release SDK'

on:
workflow_dispatch:
inputs:
release_version:
type: choice
description: 'The version to release will default to patch if not provided'
required: true
default: patch
options:
- patch
- minor
- major
- beta
- alpha

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
release:
uses: ./.github/workflows/ci.yml

bump-version:
needs: release
steps:
- name: Mark Git directory as Safe
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Bump version
id: bump_version
run: |
if [[ "${{ github.event.inputs.version_override }}" == beta || "${{ github.event.inputs.version_override }}" == alpha ]]; then
main_version="${current_version%-*}"
prerelease_version="${current_version#*-}"

# Extract the prerelease identifier and the numeric part
prerelease_identifier="${prerelease_version%[0-9]*}"
numeric_part="${prerelease_version#$prerelease_identifier}"

# Increment the numeric part
numeric_part=$(printf "%01d" $((10#$numeric_part + 1)))

# Construct the new version
new_version="${main_version}-${prerelease_identifier}${numeric_part}"
npm version $new_version
else
npm version "${{ github.event.inputs.version_override }}"
fi
version=$(node -p "require('./package.json').version")
echo "version=$version" >> $GITHUB_OUTPUT

- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken ${PUBLISH_TOKEN}
npm ci
npm run build
npm publish
env:
NPM_TOKEN: ${{ secrets.PUBLISH_TOKEN }}

- name: Push Tag
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${tag}" -m "${message}"
git push origin "${tag}"
env:
tag: v${{ needs.bump-version.outputs.version }}
message: Release v${{ needs.bump-version.outputs.version }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 10.0.0-beta01
- Initial release focused on the below products only for Android
- Support for Biometric KYC
- Support for BVN Consent
- Support for Document Verification
- Support for SmartSelfie Enrollment
- Support for SmartSelfie Authentication
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smileid/react-native",
"version": "0.1.0",
"version": "10.0.0-beta00",
"description": "Official wrapper for the Smile ID <v10 android and iOS SDKs",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -66,6 +66,7 @@
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"generate-changelog": "^1.8.0",
"jest": "^28.1.1",
"pod-install": "^0.1.0",
"prettier": "^2.0.5",
Expand Down
21 changes: 20 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3070,6 +3070,11 @@ bl@^5.0.0:
inherits "^2.0.4"
readable-stream "^3.4.0"

bluebird@^3.0.6:
version "3.7.2"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==

boxen@^7.0.0:
version "7.1.1"
resolved "https://registry.yarnpkg.com/boxen/-/boxen-7.1.1.tgz#f9ba525413c2fec9cdb88987d835c4f7cad9c8f4"
Expand Down Expand Up @@ -3430,7 +3435,7 @@ command-exists@^1.2.8:
resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69"
integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==

commander@^2.20.0:
commander@^2.20.0, commander@^2.9.0:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
Expand Down Expand Up @@ -4804,6 +4809,15 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3:
resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834"
integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==

generate-changelog@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/generate-changelog/-/generate-changelog-1.8.0.tgz#1d788cdef5a13a649da7eb2a1f3b02674850e4a8"
integrity sha512-msgpxeB75Ziyg3wGsZuPNl7c5RxChMKmYcAX5obnhUow90dBZW3nLic6nxGtst7Bpx453oS6zAIHcX7F3QVasw==
dependencies:
bluebird "^3.0.6"
commander "^2.9.0"
github-url-from-git "^1.4.0"

gensync@^1.0.0-beta.2:
version "1.0.0-beta.2"
resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
Expand Down Expand Up @@ -4918,6 +4932,11 @@ gitconfiglocal@^1.0.0:
dependencies:
ini "^1.3.2"

github-url-from-git@^1.4.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/github-url-from-git/-/github-url-from-git-1.5.0.tgz#f985fedcc0a9aa579dc88d7aff068d55cc6251a0"
integrity sha512-WWOec4aRI7YAykQ9+BHmzjyNlkfJFG8QLXnDTsLz/kZefq7qkzdfo4p6fkYYMIq1aj+gZcQs/1HQhQh3DPPxlQ==

glob-parent@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
Expand Down
Loading