-
Notifications
You must be signed in to change notification settings - Fork 134
62 lines (52 loc) · 1.83 KB
/
bump-graylog.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
name: "Bump Version"
run-name: "Bump Version - ${{ inputs.product }} ${{ inputs.version }} (branch: ${{ inputs.branch }})"
on:
workflow_dispatch:
inputs:
branch:
description: "The branch to check out"
required: true
version:
description: "The new version and revision. (Example: \"6.0.0-beta.1-1\")"
required: true
product:
description: "The product to bump"
required: true
type: "choice"
default: "graylog"
options:
- "graylog"
- "forwarder"
defaults:
run:
shell: "bash"
# Avoid having multiple workflows modifying the repo at the same time
concurrency: "repo-write"
jobs:
bump:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout ${{ inputs.branch }}"
uses: "actions/checkout@v4"
with:
ref: "${{ inputs.branch }}"
token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Install dependencies"
run: "pip3 install -r requirements.txt"
- name: "Bump ${{ inputs.product }} version to ${{ inputs.version }}"
run: "./release.py --bump ${{ inputs.product }} --version ${{ inputs.version }}"
- name: "Generate README"
run: "./release.py --generate-readme"
- name: "Commit and push"
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add version.yml README.md
git commit -m "Bump to ${{ inputs.version }}"
if [ "${{ inputs.product }}" = "forwarder" ]; then
git tag -m "Tag forwarder-${{ inputs.version }}" "forwarder-${{ inputs.version }}"
else
git tag -m "Tag ${{ inputs.version }}" "${{ inputs.version }}"
fi
git push origin "${{ inputs.branch }}"
git push --tags