-
Notifications
You must be signed in to change notification settings - Fork 12
152 lines (134 loc) · 5.24 KB
/
update-tools.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
name: Update Tools
on:
schedule:
- cron: '42 19 * * *' # daily at 19:42 UTC
workflow_dispatch: {}
concurrency: tools_update
jobs:
update:
name: Update
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout Branch
uses: paketo-buildpacks/github-config/actions/pull-request/checkout-branch@main
with:
branch: automation/tools/update
- name: Fetch Latest Jam
id: latest-jam
uses: paketo-buildpacks/github-config/actions/tools/latest@main
with:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
repo: paketo-buildpacks/jam
- name: Fetch Latest pack
id: latest-pack
uses: paketo-buildpacks/github-config/actions/tools/latest@main
with:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
repo: buildpacks/pack
- name: Fetch Latest create-package
id: latest-create-package
uses: paketo-buildpacks/github-config/actions/tools/latest@main
with:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
repo: paketo-buildpacks/libpak
- name: Fetch Latest syft
id: latest-syft
uses: paketo-buildpacks/github-config/actions/tools/latest@main
with:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
repo: anchore/syft
- name: Fetch Latest crane
id: latest-crane
uses: paketo-buildpacks/github-config/actions/tools/latest@main
with:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
repo: google/go-containerregistry
- name: Update builder tools.json
env:
JAM_VERSION: ${{ steps.latest-jam.outputs.version }}
PACK_VERSION: ${{ steps.latest-pack.outputs.version }}
CREATE_PACKAGE_VERSION: ${{ steps.latest-create-package.outputs.version }}
CRANE_VERSION: ${{ steps.latest-crane.outputs.version }}
run: |
jq --null-input \
--sort-keys \
--arg pack "${PACK_VERSION}" \
--arg crane "${CRANE_VERSION}" \
'{ pack: $pack, crane: $crane }' > ./builder/scripts/.util/tools.json
- name: Update implementation tools.json
env:
JAM_VERSION: ${{ steps.latest-jam.outputs.version }}
PACK_VERSION: ${{ steps.latest-pack.outputs.version }}
CREATE_PACKAGE_VERSION: ${{ steps.latest-create-package.outputs.version }}
run: |
jq --null-input \
--sort-keys \
--arg pack "${PACK_VERSION}" \
--arg jam "${JAM_VERSION}" \
--arg createpackage "${CREATE_PACKAGE_VERSION}" \
'{ pack: $pack, jam: $jam, createpackage: $createpackage }' > ./implementation/scripts/.util/tools.json
- name: Update language-family tools.json
env:
JAM_VERSION: ${{ steps.latest-jam.outputs.version }}
PACK_VERSION: ${{ steps.latest-pack.outputs.version }}
CREATE_PACKAGE_VERSION: ${{ steps.latest-create-package.outputs.version }}
run: |
jq --null-input \
--sort-keys \
--arg pack "${PACK_VERSION}" \
--arg jam "${JAM_VERSION}" \
'{ pack: $pack, jam: $jam }' > ./language-family/scripts/.util/tools.json
- name: Update stack tools.json
env:
JAM_VERSION: ${{ steps.latest-jam.outputs.version }}
PACK_VERSION: ${{ steps.latest-pack.outputs.version }}
SYFT_VERSION: ${{ steps.latest-syft.outputs.version }}
CRANE_VERSION: ${{ steps.latest-crane.outputs.version }}
run: |
jq --null-input \
--sort-keys \
--arg pack "${PACK_VERSION}" \
--arg jam "${JAM_VERSION}" \
--arg syft "${SYFT_VERSION}" \
'{ pack: $pack, jam: $jam, syft: $syft, crane: $crane }' > ./stack/scripts/.util/tools.json
- name: Commit
id: commit
uses: paketo-buildpacks/github-config/actions/pull-request/create-commit@main
with:
message: "Updating tools"
pathspec: "."
keyid: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY_ID }}
key: ${{ secrets.PAKETO_BOT_GPG_SIGNING_KEY }}
- name: Push Branch
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: paketo-buildpacks/github-config/actions/pull-request/push-branch@main
with:
branch: automation/tools/update
- name: Open Pull Request
if: ${{ steps.commit.outputs.commit_sha != '' }}
uses: paketo-buildpacks/github-config/actions/pull-request/open@main
with:
token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }}
title: "Updates tools"
branch: automation/tools/update
failure:
name: Alert on Failure
runs-on: ubuntu-22.04
needs: [update]
if: ${{ always() && needs.update.result == 'failure' }}
steps:
- name: File Failure Alert Issue
uses: paketo-buildpacks/github-config/actions/issue/file@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ github.repository }}
label: "failure:update-tools"
comment_if_exists: true
issue_title: "Failure: Update Tools workflow"
issue_body: |
Update Tools workflow [failed](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}).
comment_body: |
Another failure occurred: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}