-
-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (38 loc) · 1.32 KB
/
versioning.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
# Workflow for managing versioning, tagging, and conditional updates
---
name: Bump Version and Tag
on: # yamllint disable-line rule:truthy
push:
branches:
- main
workflow_dispatch:
inputs:
update_stable:
description: "Update stable tag?"
required: true
default: "false"
jobs:
versioning:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Git
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Bump Version
run: |
chmod +x ./versioning/bump_version.sh
./versioning/bump_version.sh
- name: Push Changes and Tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push https://x-access-token:${GITHUB_TOKEN}@github.com/<your-username>/<repository-name>.git main
git push https://x-access-token:${GITHUB_TOKEN}@github.com/<your-username>/<repository-name>.git --tags
- name: Conditionally Update Stable Tag
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.update_stable == 'true' }}
run: |
git tag -f stable
git push https://x-access-token:${GITHUB_TOKEN}@github.com/<your-username>/<repository-name>.git stable --force
...