-
Notifications
You must be signed in to change notification settings - Fork 71
85 lines (72 loc) · 2.91 KB
/
Copy pathbump-version.yaml
File metadata and controls
85 lines (72 loc) · 2.91 KB
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
# (C) 2023 GoodData Corporation
name: Bump version & trigger release
on:
workflow_dispatch:
inputs:
bump_type:
description: 'Type of version bump to perform (following semver).'
type: choice
required: true
default: 'minor'
options:
- major
- minor
- patch
# One bump per branch at a time, so two dispatches cannot race to bump, merge and tag.
# Keyed by branch rather than globally, so a bump from a hotfix branch is not
# blocked by one from master. Never cancels: interrupting this
# between the master push and the tag push would leave a release half-made.
concurrency:
group: bump-${{ github.ref_name }}
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
token: ${{ secrets.TOKEN_GITHUB_YENKINS_ADMIN }} # needed to push to the protected branch
- name: Install uv
uses: astral-sh/setup-uv@v10.0.1
with:
prune-cache: true
- name: Install dependencies
run: |
uv sync --only-group release --locked
- name: Bump version
id: bump
run: |
NEW_VERSION=$(uv run python ./scripts/bump_version.py ${{ github.event.inputs.bump_type }})
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
- name: Bump version in documentation
run: |
uv run python ./scripts/bump_doc_dependencies.py ${{ steps.bump.outputs.new_version }}
- name: Bump version in codebase
run: |
make release-ci VERSION=${{ steps.bump.outputs.new_version }}
- name: Create and push the new version ${{steps.bump.outputs.new_version}}
env:
VERSION: ${{ steps.bump.outputs.new_version }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
# Every release branch is rel/X.Y.Z, patches included. The docs build
# (scripts/generate.sh) and the pre-merge pipeline both key off rel/**.
git checkout -b "rel/$VERSION"
git add -A
git commit -m "Release $VERSION"
# Order matters: the docs build enumerates remote rel/* branches, so
# rel/$VERSION has to be on the remote before the tag starts anything.
git push origin "rel/$VERSION"
git checkout master
git merge "rel/$VERSION"
git push origin master
# The tag push is the single trigger for build-release and netlify-deploy.
# It works only because the checkout above uses TOKEN_GITHUB_YENKINS_ADMIN --
# GitHub does not trigger workflows from pushes made with GITHUB_TOKEN.
git tag "v$VERSION"
git push origin "v$VERSION"