This repository was archived by the owner on Mar 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (62 loc) · 2.24 KB
/
UpdateVersion.yml
File metadata and controls
70 lines (62 loc) · 2.24 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
name: Manual Release
on:
workflow_dispatch:
inputs:
tagName:
description: "Tag Name"
required: true
default: "vX.X.X.X"
permissions:
contents: write
packages: write
pull-requests: write
jobs:
validate-tag:
runs-on: ubuntu-latest
steps:
- name: Validate Tag Name
run: |
if [[ ! "${{ github.event.inputs.tagName }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid tag name format. Please use the format vX.X.X.X"
exit 1
fi
update-version:
runs-on: ubuntu-latest
needs: validate-tag
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Update XML and Update URL
run: |
version="${{ github.event.inputs.tagName }}"
version_stripped="${version#v}" # Strip the leading 'v'
xml_file="./update.xml"
xml=$(cat "$xml_file")
xml=$(echo "$xml" | sed "s|<version>.*</version>|<version>${version_stripped}</version>|")
xml=$(echo "$xml" | sed "s|<url>.*</url>|<url>https://github.com/Sebane1/PenumbraModForwarder/releases/download/${version}/PenumbraModForwarder.zip</url>|")
echo "$xml" > "$xml_file"
shell: bash
- name: Update .csproj Version
run: |
version="${{ github.event.inputs.tagName }}"
version="${version#v}" # Strip the leading 'v'
csproj_file="./PenumbraModForwarder.UI/PenumbraModForwarder.UI.csproj"
sed -i "s|<Version>.*</Version>|<Version>${version}</Version>|" "$csproj_file"
shell: bash
- name: Commit Changes
uses: devops-infra/action-commit-push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: "[AUTO-COMMIT] Update Version Number"
target_branch: ${{ github.event.inputs.tagName }}
- name: Create a PR with the changes
uses: devops-infra/action-pull-request@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
title: "Update Version Number"
source_branch: ${{ github.event.inputs.tagName }}
target_branch: "master"
get_diff: 'true'
label: 'release'