forked from LedgerHQ/device-sdk-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (67 loc) · 2.3 KB
/
update_toolchain.yml
File metadata and controls
80 lines (67 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: "[Automation] Update Toolchain"
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
env:
BRANCH_NAME: chore/no-issue-update-toolchain
jobs:
update-toolchain:
name: "Update Toolchain"
runs-on: ["ledgerhq-device-sdk"]
steps:
- uses: actions/checkout@v5
with:
ref: develop
- uses: LedgerHQ/device-sdk-ts/.github/actions/setup-with-cache-composite@develop
- name: Setup git and branch
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git checkout -b ${{ env.BRANCH_NAME }}
git push --set-upstream origin ${{ env.BRANCH_NAME }} --force
- name: Update toolchain
run: |
proto outdated --update --yes
- name: Check for changes
id: changes
run: |
echo "status=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Set new versions
id: new-versions
run: |
proto use
pnpm i
jq 'del(.packageManager)' package.json > tmp.json && mv tmp.json package.json
echo "version=$(pnpm -v)" >> $GITHUB_OUTPUT
- name: Update package.json
run: |
jq '.packageManager = "pnpm@${{ steps.new-versions.outputs.version }}"' package.json > tmp.json && mv tmp.json package.json
- name: Deduplicate
run: |
pnpm dedupe
- name: Add changes to commit
run: |
git status
git add .prototools
git add package.json
git add pnpm-lock.yaml
- name: Commit and sign
uses: planetscale/ghcommit-action@v0.2.18
with:
commit_message: "🔧 (repo): Update toolchain"
repo: ${{ github.repository }}
branch: ${{ env.BRANCH_NAME }}
file_pattern: "."
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create PR
continue-on-error: true
run: |
gh pr create \
--title "🔧 (repo) [NO-ISSUE]: Update toolchain" \
--body "This PR updates the toolchain (node, npm, pnpm) to the newest versions and deduplicates packages" \
--base develop \
--head ${{ env.BRANCH_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.DEVICE_SDK_TS_CI }}