Seregon/StratoSDK

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

Rust/27.3 KB/No license
.github/workflows/release.yml
StratoSDK / .github / workflows / release.yml
1name: Release
2 
3on:
4 push:
5 branches:
6 - main
7 workflow_dispatch:
8 
9permissions:
10 contents: write
11 
12jobs:
13 tag:
14 name: Generate Tag
15 runs-on: ubuntu-latest
16 outputs:
17 new_tag: ${{ steps.tag_version.outputs.new_tag }}
18 steps:
19 - uses: actions/checkout@v4
20 - name: Bump version and push tag
21 id: tag_version
22 uses: mathieudutour/github-tag-action@v6.2
23 with:
24 github_token: ${{ secrets.GITHUB_TOKEN }}
25 default_bump: patch
26 tag_prefix: v
27 
28 build:
29 name: Build (${{ matrix.os }})
30 needs: tag
31 runs-on: ${{ matrix.os }}
32 strategy:
33 fail-fast: false
34 matrix:
35 os: [ubuntu-latest, macos-latest, windows-latest]
36 include:
37 - os: ubuntu-latest
38 artifact_name: strato-sdk-linux
39 asset_name: strato-sdk-linux.tar.gz
40 - os: macos-latest
41 artifact_name: strato-sdk-macos
42 asset_name: strato-sdk-macos.tar.gz
43 - os: windows-latest
44 artifact_name: strato-sdk-windows
45 asset_name: strato-sdk-windows.zip
46 
47 steps:
48 - uses: actions/checkout@v4
49 
50 - name: Install Rust
51 uses: dtolnay/rust-toolchain@stable
52 
53 - name: Rust Cache
54 uses: Swatinem/rust-cache@v2
55 
56 - name: Install Dependencies (Linux)
57 if: matrix.os == 'ubuntu-latest'
58 run: |
59 sudo apt-get update
60 sudo apt-get install -y libwayland-dev libx11-dev libvulkan-dev libasound2-dev libudev-dev
61 
62 - name: Build Release
63 run: cargo build --release --workspace
64 
65 - name: Package Artifacts (Unix)
66 if: matrix.os != 'windows-latest'
67 run: |
68 mkdir -p dist
69 for f in target/release/*; do
70 if [ -f "$f" ] && [ -x "$f" ]; then
71 cp "$f" dist/
72 fi
73 done
74 tar -czf ${{ matrix.asset_name }} -C dist .
75 
76 - name: Package Artifacts (Windows)
77 if: matrix.os == 'windows-latest'
78 shell: pwsh
79 run: |
80 New-Item -ItemType Directory -Force -Path dist
81 Get-ChildItem -Path target/release/*.exe | Copy-Item -Destination dist
82 Compress-Archive -Path dist/* -DestinationPath ${{ matrix.asset_name }}
83 
84 - name: Upload Artifact
85 uses: actions/upload-artifact@v4
86 with:
87 name: ${{ matrix.artifact_name }}
88 path: ${{ matrix.asset_name }}
89 
90 release:
91 name: Create Release
92 needs: [tag, build]
93 runs-on: ubuntu-latest
94 steps:
95 - uses: actions/checkout@v4
96 
97 - name: Download all artifacts
98 uses: actions/download-artifact@v4
99 
100 - name: Create GitHub Release
101 uses: softprops/action-gh-release@v2
102 with:
103 tag_name: ${{ needs.tag.outputs.new_tag }}
104 name: Release ${{ needs.tag.outputs.new_tag }}
105 generate_release_notes: true
106 files: |
107 */*.tar.gz
108 */*.zip
109