Skip to content

Commit accf073

Browse files
authored
Update build.yml
1 parent 6de4b3e commit accf073

File tree

1 file changed

+45
-6
lines changed

1 file changed

+45
-6
lines changed

.github/workflows/build.yml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
name: Multi-Platform Build
1+
name: Multi-Platform Build & Release
22

33
on:
44
push:
55
branches: [ main ]
6+
paths-ignore:
7+
- '**.md'
68
pull_request:
79
branches: [ main ]
10+
paths-ignore:
11+
- '**.md'
812
workflow_dispatch:
913

14+
permissions:
15+
contents: write
16+
1017
jobs:
1118
build-windows:
1219
runs-on: windows-latest
@@ -16,10 +23,15 @@ jobs:
1623
run: cmake -B build -G "Visual Studio 17 2022" -A x64
1724
- name: Build
1825
run: cmake --build build --config Release
26+
- name: Rename Executable
27+
shell: pwsh
28+
run: |
29+
# 元のパスから指定の名前に変更
30+
Move-Item "build/Release/SkinGetBE.exe" "build/Release/SkinGetBE.exe"
1931
- name: Upload Artifact
2032
uses: actions/upload-artifact@v4
2133
with:
22-
name: SkinGetBE-Windows-x64
34+
name: win-x64
2335
path: build/Release/SkinGetBE.exe
2436

2537
build-linux-x64:
@@ -32,11 +44,13 @@ jobs:
3244
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
3345
- name: Build
3446
run: cmake --build build
47+
- name: Rename Binary
48+
run: mv build/SkinGetBE build/SkinGetBE_amd64
3549
- name: Upload Artifact
3650
uses: actions/upload-artifact@v4
3751
with:
38-
name: SkinGetBE-Linux-x64
39-
path: build/SkinGetBE
52+
name: linux-x64
53+
path: build/SkinGetBE_amd64
4054

4155
build-linux-arm64:
4256
runs-on: ubuntu-latest
@@ -58,8 +72,33 @@ jobs:
5872
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=arm64-toolchain.cmake
5973
- name: Build
6074
run: cmake --build build
75+
- name: Rename Binary
76+
run: mv build/SkinGetBE build/SkinGetBE_arm64
6177
- name: Upload Artifact
6278
uses: actions/upload-artifact@v4
6379
with:
64-
name: SkinGetBE-Linux-ARM64
65-
path: build/SkinGetBE
80+
name: linux-arm64
81+
path: build/SkinGetBE_arm64
82+
83+
create-release:
84+
needs: [build-windows, build-linux-x64, build-linux-arm64]
85+
runs-on: ubuntu-latest
86+
# Push時、または手動実行時のみリリースを作成
87+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
88+
steps:
89+
- name: Download all artifacts
90+
uses: actions/download-artifact@v4
91+
with:
92+
path: release_assets
93+
merge-multiple: true
94+
95+
- name: Create Release (Draft)
96+
uses: softprops/action-gh-release@v2
97+
with:
98+
tag_name: v${{ github.run_number }}
99+
name: Release v${{ github.run_number }}
100+
draft: true
101+
files: |
102+
release_assets/SkinGetBE.exe
103+
release_assets/SkinGetBE_amd64
104+
release_assets/SkinGetBE_arm64

0 commit comments

Comments
 (0)