Skip to content

Commit 7f6810c

Browse files
authored
refactor: updatecli version auto update (#861)
* deps: bump Updatecli from 0.86.0 to 0.88.1 Signed-off-by: Olivier Vernin <me@olblak.com> * refactor: updatecli auto update * refactor: template updatecli scm config Signed-off-by: Olivier Vernin <me@olblak.com> * fix: ensure nodejs is availabe in updatecli workflow Signed-off-by: Olivier Vernin <me@olblak.com> --------- Signed-off-by: Olivier Vernin <me@olblak.com>
1 parent 304d624 commit 7f6810c

File tree

3 files changed

+66
-94
lines changed

3 files changed

+66
-94
lines changed

.github/workflows/rebuild-push-dist.yml

-64
This file was deleted.

.github/workflows/updatecli.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,41 @@ on:
1111
# Run once a day
1212
- cron: '*/10 * * * *'
1313
workflow_dispatch:
14+
1415
permissions:
1516
actions: write
1617
contents: write
1718
pull-requests: write
19+
1820
jobs:
1921
updatecli:
2022
runs-on: ubuntu-latest
2123
steps:
2224
- name: Checkout
2325
uses: actions/checkout@v4
26+
27+
- name: Set Node.js 20.x
28+
uses: actions/setup-node@v4.1.0
29+
with:
30+
node-version: 20
31+
cache: npm
32+
2433
- name: "Setup updatecli"
2534
uses: "updatecli/updatecli-action@v2.75.0"
35+
2636
- name: "Run updatecli in dryrun"
2737
run: "updatecli compose diff"
2838
env:
2939
GITHUB_ACTOR: ${{ github.actor }}
3040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
3142
- uses: tibdex/github-app-token@v2.1
3243
id: generate_token
3344
if: github.ref == 'refs/heads/v2'
3445
with:
3546
app_id: ${{ secrets.UPDATECLIBOT_APP_ID }}
3647
private_key: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}
48+
3749
- name: "Run updatecli"
3850
if: github.ref == 'refs/heads/v2'
3951
run: "updatecli compose apply"

updatecli/updatecli.d/updatecli.yaml

+54-30
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,77 @@
1-
name: "deps: Bump updatecli version"
2-
pipelineid: updatecli
1+
name: "deps: bump updatecli version"
2+
pipelineid: "updatecli"
33
actions:
44
default:
5-
title: Bump updatecli version to {{ source "updatecli" }}
6-
kind: github/pullrequest
5+
kind: "github/pullrequest"
76
spec:
87
automerge: true
9-
mergemethod: squash
8+
mergemethod: "squash"
109
usetitleforautomerge: true
1110
labels:
12-
- dependencies
13-
- updatecli
14-
scmid: default
11+
- "dependencies"
12+
- "updatecli"
13+
scmid: "default"
1514
scms:
1615
default:
17-
kind: github
16+
kind: "github"
1817
spec:
19-
branch: v2
20-
email: me@olblak.com
21-
owner: updatecli
22-
repository: updatecli-action
18+
branch: '{{ .scm.branch }}'
19+
email: ' {{ .scm.email }}'
20+
owner: '{{ .scm.owner }}'
21+
repository: '{{ .scm.repository }}'
2322
token: '{{requiredEnv "GITHUB_TOKEN"}}'
24-
user: updatecli
25-
username: github-actions
23+
user: '{{ .scm.user }}'
24+
username: '{{ .scm.username }}'
2625
disabled: false
2726
sources:
2827
updatecli:
29-
name: Get latest updatecli version
30-
kind: githubrelease
28+
name: "Get latest updatecli version"
29+
kind: "githubrelease"
3130
spec:
32-
owner: updatecli
33-
repository: updatecli
31+
owner: "updatecli"
32+
repository: "updatecli"
3433
token: '{{requiredEnv "GITHUB_TOKEN"}}'
34+
versionfilter:
35+
kind: "semver"
3536
targets:
3637
src-main:
37-
name: Bump updatecli version in src/main.js
38-
kind: file
38+
name: 'deps: bump updatecli version in src/main.js to {{ source "updatecli" }}'
39+
kind: "file"
3940
spec:
40-
file: src/main.js
41-
matchpattern: "const DEFAULT_VERSION = (.+)"
41+
file: "src/main.js"
42+
matchpattern: 'const DEFAULT_VERSION = (.+)'
4243
replacepattern: 'const DEFAULT_VERSION = `{{ source "updatecli" }}`'
43-
scmid: default
44-
sourceid: updatecli
44+
scmid: "default"
45+
sourceid: "updatecli"
46+
4547
test-main:
46-
name: Bump updatecli version in tests/main.test.js
47-
kind: file
48+
name: 'deps: bump updatecli version in tests/main.test.js to {{ source "updatecli" }}'
49+
kind: "file"
4850
spec:
49-
file: tests/main.test.js
51+
file: "tests/main.test.js"
5052
matchpattern: "const DEFAULT_VERSION = (.+)"
5153
replacepattern: 'const DEFAULT_VERSION = `{{ source "updatecli" }}`'
52-
scmid: default
53-
sourceid: updatecli
54+
scmid: "default"
55+
sourceid: "updatecli"
56+
57+
dist:
58+
name: 'chore: rebuild the dist directory'
59+
dependson:
60+
- "src-main"
61+
- "test-main"
62+
disablesourceinput: true
63+
kind: shell
64+
scmid: "default"
65+
spec:
66+
command: |
67+
npm ci
68+
npm run prepare
69+
changedif:
70+
kind: file/checksum
71+
spec:
72+
files:
73+
- "dist/index.js"
74+
- "dist/index.js.map"
75+
environments:
76+
- name: "PATH"
77+
- name: "HOME"

0 commit comments

Comments
 (0)