Skip to content

Commit 6dc0d2e

Browse files
committed
[ADD] : add actions for generate packages
1 parent 59ea717 commit 6dc0d2e

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: linux package
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
package_Linux:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: master
15+
token: ${{ secrets.PAT_SUBMODULES }}
16+
submodules: recursive
17+
- name: Install OpenGL lib / Requirement for Glfw3
18+
run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libx11-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libwayland-dev
19+
- name: configure
20+
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release
21+
- name: build
22+
run: cmake --build build --config Release
23+
- name: package
24+
run: cmake --build build --config Release --target package
25+
- name: extract version
26+
id: ver
27+
run: |
28+
VERSION=$(grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' VERSION | head -n1)
29+
echo "version=$VERSION" >> $GITHUB_OUTPUT
30+
- name: upload to draft release
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
tag_name: ${{ steps.ver.outputs.version }}
34+
name: ${{ steps.ver.outputs.version }}
35+
draft: true
36+
files: bin/packages/${{ github.event.repository.name }}_*

.github/workflows/win_package.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: win package
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
package_Win:
8+
runs-on: windows-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: master
15+
token: ${{ secrets.PAT_SUBMODULES }}
16+
submodules: recursive
17+
- name: configure
18+
run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release
19+
- name: build
20+
run: cmake --build build --config Release
21+
- name: package
22+
run: cmake --build build --config Release --target package
23+
- name: extract version
24+
id: ver
25+
shell: pwsh
26+
run: |
27+
$content = Get-Content VERSION -Raw
28+
if ($content -match 'v[\d\.]+') { $version = $Matches[0] } else { $version = 'v0.0.0' }
29+
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
30+
- name: upload to draft release
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
tag_name: ${{ steps.ver.outputs.version }}
34+
name: ${{ steps.ver.outputs.version }}
35+
draft: true
36+
files: bin/packages/${{ github.event.repository.name }}_*

0 commit comments

Comments
 (0)