-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (92 loc) · 2.87 KB
/
release.yml
File metadata and controls
113 lines (92 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
default: 'manual'
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build-native:
name: Build Native (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: wcanvas-macos-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: wcanvas-macos-aarch64
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
# No additional dependencies needed for basic build
- name: Build
run: |
cargo build --release --target ${{ matrix.target }}
- name: Create artifact directory
run: mkdir -p artifacts
- name: Copy binary and assets (macOS)
if: matrix.os == 'macos-latest'
run: |
cp target/${{ matrix.target }}/release/wcanvas artifacts/wcanvas
cp -r data artifacts/
cp index.html artifacts/
chmod +x artifacts/wcanvas
- name: Create archive
run: |
cd artifacts
tar -czf ../${{ matrix.artifact_name }}.tar.gz *
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}.tar.gz
release:
name: Create Release
needs: [build-native]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Display structure of downloaded files
run: ls -la artifacts/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name || github.event.inputs.version }}
name: WCanvas ${{ github.ref_name || github.event.inputs.version }}
body: |
## Changes
- Built for macOS (x86_64 and ARM64)
## Downloads
- **macOS (Intel)**: wcanvas-macos-x86_64.tar.gz
- **macOS (Apple Silicon)**: wcanvas-macos-aarch64.tar.gz
## Usage
1. Download the appropriate archive for your system
2. Extract the archive
3. Run `./wcanvas`
draft: false
prerelease: false
files: |
./artifacts/wcanvas-macos-x86_64/wcanvas-macos-x86_64.tar.gz
./artifacts/wcanvas-macos-aarch64/wcanvas-macos-aarch64.tar.gz