Skip to content

Commit 2d85e64

Browse files
Reinstate workflow
1 parent a5abccf commit 2d85e64

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Update dependencies
2+
3+
on:
4+
# Allow manual executions
5+
workflow_dispatch:
6+
# Run nightly
7+
schedule:
8+
- cron: '0 0 * * *'
9+
10+
jobs:
11+
propose_github_release_updates:
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
matrix:
15+
include:
16+
- key: kolla
17+
path: src/kayobe-config/etc/kayobe/stackhpc.yml
18+
repository: stackhpc/kolla
19+
search_regex: 'stackhpc_kolla_source_version\:.*$'
20+
prefix: 'stackhpc_kolla_source_version\: '
21+
22+
- key: kolla-ansible
23+
path: src/kayobe-config/etc/kayobe/stackhpc.yml
24+
repository: stackhpc/kolla-ansible
25+
search_regex: 'stackhpc_kolla_ansible_source_version\:.*$'
26+
prefix: 'stackhpc_kolla_ansible_source_version\: '
27+
28+
- key: kayobe
29+
path: src/kayobe-config/requirements.txt
30+
repository: stackhpc/kayobe
31+
search_regex: '@stackhpc\/.*$'
32+
prefix: '@'
33+
permissions: write-all
34+
name: ${{ matrix.key }}
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
path: ${{ github.workspace }}/src/kayobe-config
40+
41+
- name: Determine OpenStack release
42+
id: openstack_release
43+
run: |
44+
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
45+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
46+
working-directory: ${{ github.workspace }}/src/kayobe-config
47+
48+
- name: Checkout the dependency repo
49+
uses: actions/checkout@v4
50+
with:
51+
repository: ${{ matrix.repository }}
52+
ref: stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
53+
fetch-tags: true
54+
path: ${{ github.workspace }}/src/${{ matrix.key }}
55+
56+
- name: Get latest tag
57+
id: latest_tag
58+
run: |
59+
TAG=$(git describe --tags --abbrev=0 --match stackhpc/\*)
60+
echo latest_tag=${TAG} >> $GITHUB_OUTPUT
61+
working-directory: ${{ github.workspace }}/src/${{ matrix.key }}
62+
63+
- name: Update dependency key
64+
run: |
65+
TAG_OVERRIDE=$(echo $TAG | sed 's/\//\\\//g')
66+
sed -i "s/$SEARCH/$PREFIX$TAG_OVERRIDE/g" $REQUIREMENTS
67+
env:
68+
PREFIX: ${{ matrix.prefix }}
69+
TAG: ${{ steps.latest_tag.outputs.latest_tag }}
70+
REQUIREMENTS: ${{ github.workspace }}/${{ matrix.path }}
71+
SEARCH: ${{ matrix.search_regex }}
72+
73+
- name: Propose changes via PR if required
74+
uses: peter-evans/create-pull-request@v7
75+
with:
76+
path: ${{ github.workspace }}/src/kayobe-config
77+
commit-message: >-
78+
Bump ${{ matrix.key }} to ${{ steps.latest_tag.outputs.latest_tag }}
79+
branch: update-dependency/${{ matrix.key }}
80+
delete-branch: true
81+
title: >-
82+
Bump ${{ matrix.key }} to ${{ steps.latest_tag.outputs.latest_tag }}
83+
body: >
84+
This PR was created automatically to update
85+
${{ matrix.key }} to ${{ steps.latest_tag.outputs.latest_tag }}.

0 commit comments

Comments
 (0)