Skip to content

Commit fe230cf

Browse files
Enhance deploy.yml with release tag options
Added inputs for release tag selection in deploy workflow.
1 parent df4da39 commit fe230cf

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ name: Deploy
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
release_tag_option:
7+
description: "Release tag to upload binaries to"
8+
type: choice
9+
options:
10+
- ClassicUO-dev-release
11+
- custom
12+
default: ClassicUO-dev-release
13+
custom_release_tag:
14+
description: "Custom tag name (used only if option is 'custom')"
15+
type: string
16+
required: false
517
workflow_run:
618
branches: [main]
719
workflows: [Build-Test]
@@ -27,6 +39,11 @@ jobs:
2739

2840
env:
2941
CUO_ZIP_NAME: "ClassicUO-${{ matrix.target }}-release.zip"
42+
# Determine the release tag:
43+
# - If dispatch option == 'custom' and a custom tag is provided, use it
44+
# - Else use the selected option (default 'ClassicUO-dev-release')
45+
# - For workflow_run (no inputs), fallback to the default
46+
RELEASE_TAG: ${{ inputs.release_tag_option == 'custom' && inputs.custom_release_tag || inputs.release_tag_option || 'ClassicUO-dev-release' }}
3047

3148
strategy:
3249
matrix:
@@ -62,10 +79,10 @@ jobs:
6279
if: matrix.os == 'windows-latest'
6380
id: upload-unsigned-artifact
6481
uses: actions/upload-artifact@v4
65-
with:
82+
with:
6683
name: "ClassicUO-${{ matrix.target }}-release"
6784
path: "${{ env.CUO_OUTPUT_PATH }}"
68-
85+
6986
- name: Create manifest
7087
run: |
7188
dotnet run --project tools/ManifestCreator/ManifestCreator.csproj "${{ env.CUO_OUTPUT_PATH }}" "dev-preview" "${{ env.CUO_ZIP_NAME }}"
@@ -87,8 +104,8 @@ jobs:
87104
run: |
88105
git config user.name "github-actions[bot]"
89106
git config user.email "github-actions[bot]@users.noreply.github.com"
90-
git tag -f ClassicUO-dev-release
91-
git push -f origin ClassicUO-dev-release
107+
git tag -f "${{ env.RELEASE_TAG }}"
108+
git push -f origin "${{ env.RELEASE_TAG }}"
92109
93110
- id: SignPath
94111
if: matrix.os == 'windows-latest'
@@ -121,7 +138,7 @@ jobs:
121138
draft: false
122139
prerelease: true
123140
allowUpdates: true
124-
tag: "ClassicUO-dev-release"
141+
tag: "${{ env.RELEASE_TAG }}"
125142
token: ${{ secrets.GITHUB_TOKEN }}
126143
commit: ${{ github.sha }}
127144

@@ -135,11 +152,10 @@ jobs:
135152
draft: false
136153
prerelease: true
137154
allowUpdates: true
138-
tag: "ClassicUO-dev-release"
155+
tag: "${{ env.RELEASE_TAG }}"
139156
token: ${{ secrets.GITHUB_TOKEN }}
140157
commit: ${{ github.sha }}
141158

142-
143159
# - name: Repo Preparation - clone
144160
# uses: actions/checkout@master
145161
# with:
@@ -162,4 +178,3 @@ jobs:
162178
# destination-repository-name: "deploy"
163179
# commit-message: "release ${{ env.CUO_ASSEMBLY_VERSION }} on ${{ matrix.target }}"
164180
# target-branch: main
165-

0 commit comments

Comments
 (0)