Skip to content

Commit 247804f

Browse files
authored
feat(ci): Update GitHub Actions workflow to package and release build artifacts (#21)
1 parent 2660b68 commit 247804f

File tree

1 file changed

+47
-4
lines changed

1 file changed

+47
-4
lines changed

.github/workflows/cmake.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,61 @@ jobs:
1616
uses: actions/checkout@v4.1.1
1717

1818
- name: Configure CMake
19-
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
19+
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
2020

2121
- name: Build
2222
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
23-
23+
2424
- name: Install
2525
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install
2626

27-
- name: Upload artifacts
27+
- name: Organize release files
28+
run: |
29+
mkdir -p ${{github.workspace}}\artifacts\
30+
xcopy /Y "${{github.workspace}}\install\bin\*" "${{github.workspace}}\artifacts\"
31+
xcopy /Y "${{github.workspace}}\scripts\autorun\reframework-d2d.lua" "${{github.workspace}}\artifacts\"
32+
shell: cmd
33+
34+
- name: Upload artifacts (DLL and Lua)
2835
uses: actions/upload-artifact@v4.3.1
2936
with:
3037
name: REFramework-D2D
31-
path: ${{github.workspace}}/install/bin/*
38+
path: |
39+
${{github.workspace}}\artifacts\*
3240
if-no-files-found: error
3341

42+
release:
43+
needs: build
44+
if: startsWith(github.ref, 'refs/tags/v')
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
50+
51+
- name: Download built artifacts
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: REFramework-D2D
55+
path: ${{github.workspace}}/release-temp
56+
57+
- name: Organize release files
58+
run: |
59+
mkdir -p ${{github.workspace}}/release/reframework/plugins/
60+
mkdir -p ${{github.workspace}}/release/reframework/autorun/
61+
mv ${{github.workspace}}/release-temp/reframework-d2d.dll ${{github.workspace}}/release/reframework/plugins/
62+
mv ${{github.workspace}}/release-temp/reframework-d2d.lua ${{github.workspace}}/release/reframework/autorun/
63+
shell: bash
64+
65+
- name: Package release files
66+
run: |
67+
cd ${{github.workspace}}/release
68+
zip -r REFramework-D2D.zip reframework
69+
shell: bash
70+
71+
- name: Publish GitHub Release
72+
uses: softprops/action-gh-release@v2
73+
with:
74+
files: ${{github.workspace}}/release/REFramework-D2D.zip
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)