-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (80 loc) · 2.88 KB
/
prepare-release.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
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: New release version
required: true
type: choice
default: minor
options:
- major
- minor
- patch
jobs:
create-release-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: "${{ secrets.RENKUBOT_GITHUB_TOKEN }}"
- name: Setup Git
run: |
git config --global --add user.name "Renku Bot"
git config --global --add user.email "[email protected]"
git config push.autoSetupRemote true
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: "20.11.0"
- name: Get old version
id: get_old_version
run: |
VERSION=$(npm version --json | grep "renku-ui" | awk -F: '{ print $2 }' | awk -F'"' '{ print $2 }')
echo "$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
working-directory: ./client
- name: Bump client version
run: npm version ${{ github.event.inputs.version }}
working-directory: ./client
- name: Bump server version
run: npm version ${{ github.event.inputs.version }}
working-directory: ./server
- name: Get version
id: get_version
run: |
VERSION=$(npm version --json | grep "renku-ui" | awk -F: '{ print $2 }' | awk -F'"' '{ print $2 }')
echo "$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
working-directory: ./client
- name: Bump version in Chart.yaml and values.yaml
run: |
sed -i -e"s/${{ steps.get_old_version.outputs.version }}/${{ steps.get_version.outputs.version }}/" Chart.yaml values.yaml
working-directory: ./helm-chart/renku-ui
- name: Create Branch
run: git switch -c "release-${{ steps.get_version.outputs.version }}"
- name: Commit changes
run: |
git add client server helm-chart
git commit -m "build: release ${{ steps.get_version.outputs.version }}"
git push
- name: Create Pull Request
uses: actions/github-script@v7
with:
github-token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }}
script: |
const { repo, owner } = context.repo;
const result = await github.rest.pulls.create({
title: 'release ${{ steps.get_version.outputs.version }}',
owner,
repo,
head: 'release-${{ steps.get_version.outputs.version }}',
base: 'main',
body: [
'Release ${{ steps.get_version.outputs.version }}',
'',
'This PR is auto-generated by [actions/github-script](https://github.com/actions/github-script).',
'',
'/deploy ',
].join('\n')
});