forked from snazy/nessie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
57 lines (54 loc) · 2.3 KB
/
action.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
name: 'Bump versions'
description: 'Updates versions for Python, UI, helm + site'
inputs:
new-version:
required: true
description: 'Version to bump to'
bump-helm-version:
required: false
default: 'false'
description: 'Whether to apply the new version to helm charts'
bump-site-version:
required: false
default: 'false'
description: 'Whether to apply the new version to site docs'
runs:
using: "composite"
steps:
- name: Bump Python release version ${{ inputs.new-version }}
shell: bash
working-directory: ./python
env:
NEW_VERSION: ${{ inputs.new-version }}
run: |
# bump2version 1.0.1 has a bug: https://github.com/c4urself/bump2version/issues/214
if [[ "$(python -c 'import pynessie; print(pynessie.__version__)')" != ${NEW_VERSION} ]] ; then
bump2version --no-commit --no-tag --allow-dirty --new-version ${NEW_VERSION} minor
# Call into pynessie to ensure bump2version didn't mess up anything
echo "pynessie at release-version $(python -c 'import pynessie; print(pynessie.__version__)')"
else
echo "pynessie already at release-version ${NEW_VERSION}"
fi
- name: Bump versions in site/ to ${{ inputs.new-version }}
if: ${{ inputs.bump-site-version == 'true' }}
shell: bash
env:
NEW_VERSION: ${{ inputs.new-version }}
run: |
sed -i "s/^ java: [0-9.]*$/ java: ${NEW_VERSION}/" site/mkdocs.yml
sed -i "s/^ python: v[0-9.]*$/ python: v${NEW_VERSION}/" site/mkdocs.yml
- name: Bump version in helm/nessie to ${{ inputs.new-version }}
if: ${{ inputs.bump-helm-version == 'true' }}
shell: bash
env:
NEW_VERSION: ${{ inputs.new-version }}
run: |
sed -i "s/^version: [0-9.]*$/version: ${NEW_VERSION}/" helm/nessie/Chart.yaml
- name: Bump UI release version ${{ inputs.new-version }}
shell: bash
working-directory: ./ui
env:
NEW_VERSION: ${{ inputs.new-version }}
run: |
jq ".version = \"${NEW_VERSION}\"" < package.json > /tmp/package.json && mv /tmp/package.json package.json
jq ".version = \"${NEW_VERSION}\" | .packages[\"\"].version = \"${NEW_VERSION}\"" < package-lock.json > /tmp/package-lock.json && mv /tmp/package-lock.json package-lock.json