-
Notifications
You must be signed in to change notification settings - Fork 23
49 lines (39 loc) · 1.48 KB
/
bump-version.yml
File metadata and controls
49 lines (39 loc) · 1.48 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
name: Bump Version
on:
workflow_dispatch:
inputs:
version:
description: 'New version number'
required: true
jobs:
update_version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.APT_REPO_ACCESS_TOKEN }}
- name: Set up Git
run: |
git config --local user.email "info@tngtech.com"
git config --local user.name "TNG Technology Consulting"
- name: Check if branch already exists
run: |
if git ls-remote --exit-code --heads origin "release/v${{ github.event.inputs.version }}" > /dev/null; then
echo "Error: Branch v${{ github.event.inputs.version }} already exists!"
exit 1
fi
- name: Create a new branch
run: |
git checkout -b "release/v${{ github.event.inputs.version }}"
- name: Update version number in please.sh
run: |
sed -i "s/VERSION_NUMBER/${{ github.event.inputs.version }}/" please.sh
git add please.sh
git commit -m "Update version number to ${{ github.event.inputs.version }}"
- name: Push the new branch
run: git push -u origin "release/v${{ github.event.inputs.version }}"
- name: Create a new tag
run: |
git tag -a "v${{ github.event.inputs.version }}" -m "Version ${{ github.event.inputs.version }}"
git push origin "v${{ github.event.inputs.version }}"