Skip to content

Commit 34fcfb3

Browse files
committed
Update workflow to trigger for all branches
1 parent c42cde3 commit 34fcfb3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Build and Release EasySFTP
22

33
on:
44
push:
5+
branches:
6+
- '*'
57
tags:
6-
- 'v*' # v1.2.3.4 のようなタグが push されたら発火
8+
- 'v*'
79
workflow_dispatch:
810

911
jobs:
@@ -49,7 +51,6 @@ jobs:
4951
echo "❌ Required deps cache was not found. Aborting."
5052
exit 1
5153
52-
# --- Common.user.props の生成 ---
5354
- name: Generate Common.user.props
5455
shell: pwsh
5556
run: |
@@ -107,15 +108,15 @@ jobs:
107108
path: dist/
108109

109110
- name: Create zip archive
110-
if: github.event_name != 'workflow_dispatch'
111+
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'workflow_dispatch'
111112
shell: pwsh
112113
run: |
113114
$tag = "${{ github.ref_name }}" # 例: v1.2.3.4
114115
$version = $tag.TrimStart("v") # 先頭のvを取る
115116
Compress-Archive -Path dist\* -DestinationPath "EasySFTP-$version.zip"
116117
117118
- name: Extract release notes from CHANGELOG.md
118-
if: github.event_name != 'workflow_dispatch'
119+
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'workflow_dispatch'
119120
id: changelog
120121
shell: pwsh
121122
run: |
@@ -139,7 +140,7 @@ jobs:
139140
}
140141
141142
- name: Upload release asset
142-
if: github.event_name != 'workflow_dispatch'
143+
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'workflow_dispatch'
143144
uses: softprops/action-gh-release@v2
144145
with:
145146
tag_name: ${{ env.TAG_NAME }}

0 commit comments

Comments
 (0)