Skip to content

Commit

Permalink
feat: convert updatecli pipeline to updatecli-compose.yaml
Browse files Browse the repository at this point in the history
* Update deprecated Updatecli syntax
* Move github action workflow to updatecli-compose.yaml
  • Loading branch information
olblak committed Jan 14, 2025
1 parent 8354525 commit 4e6a76e
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 98 deletions.
62 changes: 0 additions & 62 deletions .github/workflows/rebuild-push-dist.yml

This file was deleted.

18 changes: 12 additions & 6 deletions .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ jobs:
- name: "Setup updatecli"
uses: "updatecli/updatecli-action@v2"

- name: Set Node.js 20.x
uses: actions/setup-node@v4.1.0
with:
node-version: 20
cache: npm

- name: "Run updatecli in dryrun"
run: "updatecli diff --config ./updatecli/updatecli.d"
run: "updatecli compose diff"
env:
UPDATECLI_GITHUB_ACTOR: ${{ github.actor }}
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: tibdex/github-app-token@v2.1
id: generate_token
Expand All @@ -38,8 +44,8 @@ jobs:
private_key: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }}

- name: "Run updatecli"
run: "updatecli apply --config ./updatecli/updatecli.d"
run: "updatecli compose apply"
env:
UPDATECLI_GITHUB_ACTOR: ${{ secrets.UPDATECLI_BOT_GITHUB_ACTOR }}
UPDATECLI_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
GITHUB_ACTOR: ${{ secrets.UPDATECLI_BOT_GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

23 changes: 23 additions & 0 deletions updatecli-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
policies:
- name: Local Updatecli Website Policies
config:
- updatecli/updatecli.d/
- name: Handle Nodejs version in githubaction
policy: ghcr.io/updatecli/policies/nodejs/githubaction:0.8.0@sha256:e0784741fa1628f498336c5154ad406df587fe7fa4c163f23deeed3ffc8809d2
values:
- updatecli/values.d/scm.yaml
- updatecli/values.d/nodejs.yaml
- name: Update Updatecli policies
policy: ghcr.io/updatecli/policies/updatecli/autodiscovery:0.5.0@sha256:947817644fb89e27f7b7121b822328c2d47364c7a3a08241e4d2ac1a5897020c
values:
- updatecli/values.d/scm.yaml
- name: NPM autodiscovery
policy: ghcr.io/updatecli/policies/npm/autodiscovery:0.9.0@sha256:bfb7aaa719c26db1e13095fec27c143cf2c99b64b577d200a0bb658b724d37ae
values:
- updatecli/values.d/scm.yaml
- updatecli/values.d/npm.yaml
- name: Handle Updatecli version in GitHub action
policy: ghcr.io/updatecli/policies/updatecli/githubaction:0.4.0@sha256:2879297d2f973081e67b560066f1640304a173167d5b1e8e1452c02920cdbf4d
values:
- updatecli/values.d/scm.yaml

28 changes: 0 additions & 28 deletions updatecli/updatecli.d/npm.yaml

This file was deleted.

25 changes: 23 additions & 2 deletions updatecli/updatecli.d/releasepost.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pipelineid: releasepost
title: Bump releasepost version
name: Bump releasepost version
actions:
default:
title: Bump releasepost version to {{ source "releasepost" }}
Expand Down Expand Up @@ -37,7 +37,28 @@ targets:
kind: yaml
spec:
file: action.yaml
key: inputs.version.default
key: $.inputs.version.default
scmid: default
sourceid: releasepost

dist:
name: 'chore: rebuild the dist directory'
dependson:
- "action"
disablesourceinput: true
kind: shell
scmid: "default"
spec:
command: |
npm ci
npm run prepare
changedif:
kind: file/checksum
spec:
files:
- "dist/index.js"
- "dist/index.js.map"
environments:
- name: "PATH"
- name: "HOME"

3 changes: 3 additions & 0 deletions updatecli/values.d/nodejs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
versionpattern: "~20"
automerge: true

2 changes: 2 additions & 0 deletions updatecli/values.d/npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
automerge: true
groupby: individual
8 changes: 8 additions & 0 deletions updatecli/values.d/scm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
scm:
enabled: true
user: updatecli
email: updatecli-bot@updatecli.io
owner: updatecli
repository: releasepost-action
username: "updatecli"
branch: main

0 comments on commit 4e6a76e

Please sign in to comment.