Skip to content

Commit

Permalink
🚀 (core): Release v0.3.0 (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbertin-ledger authored Jun 14, 2024
2 parents 2608c26 + 41ff420 commit 447a3bb
Show file tree
Hide file tree
Showing 315 changed files with 22,848 additions and 6,829 deletions.
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "LedgerHQ/device-sdk-ts"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "develop",
"updateInternalDependencies": "patch",
"ignore": []
}
27 changes: 27 additions & 0 deletions .github/actions/danger-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e

is_running_on_github_actions() {
[ -n "$CI" ] && [ -n "$GITHUB_ACTIONS" ]
}

run_danger_on_github_actions() {
echo "Script is running within GitHub Actions workflow."
pnpm danger ci --dangerfile danger/dangerfile.ts --failOnErrors
}

run_danger_on_local() {
echo "Script is running locally."
pnpm danger pr --dangerfile danger/dangerfile.ts https://github.com/LedgerHQ/device-sdk-ts/pull/${1}
}

if is_running_on_github_actions; then
run_danger_on_github_actions
else
if [ -z "$1" ]; then
echo "Argument PR number is missing"
exit 1
fi
run_danger_on_local "$1"
fi

28 changes: 28 additions & 0 deletions .github/actions/setup-toolchain-composite/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Setup Device SDK toolchain"
description: "Composite job to setup the CI tools for Device SDK"

runs:
using: "composite"
steps:
- uses: moonrepo/setup-toolchain@v0

- name: Install toolchain
shell: bash
run: proto use

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "github-actions"
- "dependencies"
reviewers:
- "LedgerHQ/live-devices"
# Maintain dependencies for pnpm
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
labels:
- "pnpm"
- "dependencies"
reviewers:
- "LedgerHQ/live-devices"
41 changes: 41 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
Thank you for your contribution! 👍
Please make sure to read CONTRIBUTING.md if you have not already. Pull Requests that do not comply with the rules will be arbitrarily closed.
-->

### 📝 Description

_Replace this text by a clear and concise description of what this pull request is about and why it is needed. Be sure to explain the problem you're addressing and the solution you're proposing._
_For libraries, you can add a code sample of how to use it._
_For bugfixes, you can explain the previous behavior and how it was fixed._
_In case of visual features, please attach screenshots or video recordings to demonstrate the changes._

<!--
| Before | After |
| ------------- | ------------- |
| | |
-->

### ❓ Context

- **JIRA or GitHub link**: <!-- Attach the relevant ticket number if applicable. (e.g., [JIRA-123] for Jira or #123 for a Github issue) -->

### ✅ Checklist

Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.

- [ ] **Covered by automatic tests.** <!-- if not, please explain. (Feature must be tested / Bugfix must bring non-regression) -->
- [ ] **Impact of the changes:** <!-- Please take some time to list the impact & what specific areas Quality Assurance (QA) should focus on -->
- ...

---

### 🧐 Checklist for the PR Reviewers

<!-- Please do not edit this if you are the PR author -->

- [ ] **The code aligns with the requirements** described in the linked JIRA or GitHub issue.
- [ ] **The PR description clearly documents the changes** made and explains any technical trade-offs or design decisions.
- [ ] **There are no undocumented trade-offs**, technical debt, or maintainability issues.
- [ ] **The PR has been tested** thoroughly, and any potential edge cases have been considered and handled.
- [ ] **Any new dependencies** have been justified and documented.
64 changes: 64 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Pull Request
on:
pull_request:
types: [opened, synchronize, reopened, edited]

env:
FORCE_COLOR: "1"

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name != 'develop' && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
auto-assign:
name: Auto assign
runs-on: ubuntu-latest
steps:
- uses: toshimaru/[email protected]

danger:
name: Run Danger check
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-toolchain-composite

- name: Danger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Workaround when using custom runners
# https://github.com/danger/danger-js/issues/1374
DANGER_GITHUB_API_BASE_URL: "https://api.github.com"
run: ./.github/actions/danger-check.sh

health-check:
name: Run health check
needs: [danger]
runs-on: device-sdk-4xlarge-linux
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-toolchain-composite

- name: health check
run: pnpm health-check

unit-tests:
name: Run unit tests
needs: [danger]
runs-on: device-sdk-4xlarge-linux
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-toolchain-composite

- name: Test
run: pnpm test:coverage -- --max-warnings=0

- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.GREEN_SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.GREEN_SONAR_HOST_URL }}
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: publish npm packages
on:
push:
branches:
- main

env:
FORCE_COLOR: "1"

jobs:
publish:
environment: Production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-toolchain-composite

- name: install dependencies
run: pnpm install

- name: build libraries
run: pnpm build

- name: publish
uses: changesets/action@v1
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPMJS_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: create release pull request
on:
push:
branches:
- release

env:
FORCE_COLOR: "1"

jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-toolchain-composite

- name: install dependencies
run: pnpm install

- name: build libraries
run: pnpm build

- name: create release pull request or publish
uses: changesets/action@v1
with:
version: pnpm bump
commit: "🔖 (release): versioning packages"
title: "🔖 (release) [NO-ISSUE]: versioning packages"
env:
GITHUB_TOKEN: ${{ github.token }}
28 changes: 12 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,30 @@ lib-cov
*.gz
*.swp

pids
logs
results
tmp

# Build
public/css/main.css

# Coverage reports
coverage

# API keys and secrets
.env

# Dependency directory
# node
node_modules
bower_components

# Editors
# IDE
.idea
.vscode
*.iml

# OS metadata
# misc
.DS_Store
Thumbs.db

# Ignore built ts files
dist/**/*
# build
lib
!apps/sample/src/lib/

# turbo
.turbo

# ignore yarn.lock
yarn.lock
# eslint
.eslintcache
3 changes: 3 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node = "20.12.2"
npm = "10.5.2"
pnpm = "9.0.5"
Loading

0 comments on commit 447a3bb

Please sign in to comment.