Skip to content

Commit 3461dcd

Browse files
[+]Automatic Release archive file generated
1 parent a14f784 commit 3461dcd

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
name: Build ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
include:
15+
- os: windows-latest
16+
artifact_name: xary-v1.0.0-windows-x64.zip
17+
asset_name: xary.exe
18+
- os: ubuntu-latest
19+
artifact_name: xary-v1.0.0-linux-x64.tar.gz
20+
asset_name: xary
21+
- os: macos-latest
22+
artifact_name: xary-v1.0.0-macos-x64.tar.gz
23+
asset_name: xary
24+
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v4
28+
29+
- name: Configure CMake
30+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
31+
32+
- name: Build Binary
33+
run: cmake --build build --config Release --parallel
34+
35+
- name: Package Windows Binary
36+
if: runner.os == 'Windows'
37+
run: |
38+
compress-archive -Path build/Release/xary.exe, README.md, LICENSE -DestinationPath ${{ matrix.artifact_name }}
39+
40+
- name: Package Linux / macOS Binary
41+
if: runner.os != 'Windows'
42+
run: |
43+
tar -czvf ${{ matrix.artifact_name }} -C build xary ../README.md ../LICENSE
44+
45+
- name: Upload Binaries to Release
46+
uses: softprops/action-gh-release@v1
47+
with:
48+
files: ${{ matrix.artifact_name }}
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)