-
Notifications
You must be signed in to change notification settings - Fork 1
161 lines (153 loc) · 5.23 KB
/
Copy pathrelease.yml
File metadata and controls
161 lines (153 loc) · 5.23 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
tag:
description: Existing tag to build and publish
required: true
type: string
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build-linux:
name: Build simplex-tui-linux-x86_64
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build application and native SimpleX library
run: cargo build --locked --release -p simplex-tui
- name: Package release
env:
ASSET: simplex-tui-linux-x86_64
run: |
set -euo pipefail
package="dist/$ASSET"
mkdir -p "$package"
cp target/release/simplex-tui "$package/"
cp README.md LICENSE "$package/"
cp vendor/libsimplex/*.so "$package/"
tar -C dist -czf "dist/$ASSET.tar.gz" "$ASSET"
(cd dist && sha256sum "$ASSET.tar.gz" > "$ASSET.tar.gz.sha256")
- uses: actions/upload-artifact@v4
with:
name: release-linux
path: |
dist/simplex-tui-linux-x86_64.tar.gz
dist/simplex-tui-linux-x86_64.tar.gz.sha256
if-no-files-found: error
build-macos:
name: Build macOS ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
arch: aarch64
- os: macos-15-intel
arch: x86_64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build application and native SimpleX library
run: cargo build --locked --release -p simplex-tui
- name: Stage architecture files
env:
ARCH: ${{ matrix.arch }}
run: |
set -euo pipefail
mkdir -p dist
cp target/release/simplex-tui "dist/simplex-tui-$ARCH"
cp vendor/libsimplex/libsimplex.dylib "dist/libsimplex-$ARCH.dylib"
- uses: actions/upload-artifact@v4
with:
name: raw-macos-${{ matrix.arch }}
path: dist/*
if-no-files-found: error
package-macos:
name: Package simplex-tui-macos-universal
needs: build-macos
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: raw-macos-*
path: dist/raw
merge-multiple: true
- name: Create universal macOS package
run: |
set -euo pipefail
asset="simplex-tui-macos-universal"
package="dist/$asset"
mkdir -p "$package"
lipo -create dist/raw/simplex-tui-aarch64 dist/raw/simplex-tui-x86_64 -output "$package/simplex-tui"
lipo -create dist/raw/libsimplex-aarch64.dylib dist/raw/libsimplex-x86_64.dylib -output "$package/libsimplex.dylib"
chmod +x "$package/simplex-tui"
cp README.md LICENSE "$package/"
tar -C dist -czf "dist/$asset.tar.gz" "$asset"
(cd dist && shasum -a 256 "$asset.tar.gz" > "$asset.tar.gz.sha256")
- uses: actions/upload-artifact@v4
with:
name: release-macos
path: |
dist/simplex-tui-macos-universal.tar.gz
dist/simplex-tui-macos-universal.tar.gz.sha256
if-no-files-found: error
build-windows:
name: Build simplex-tui-windows-x86_64
runs-on: windows-2025
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Bootstrap libsimplex on Windows
shell: pwsh
run: ./scripts/bootstrap-simplex-windows.ps1
- name: Build application and native SimpleX library
run: cargo build --locked --release -p simplex-tui
- name: Package release
shell: pwsh
run: |
$Asset = "simplex-tui-windows-x86_64"
$Package = Join-Path "dist" $Asset
New-Item -ItemType Directory -Force $Package | Out-Null
Copy-Item "target/release/simplex-tui.exe" $Package
Copy-Item "README.md", "LICENSE" $Package
Copy-Item "vendor/libsimplex/*.dll" $Package
$Archive = Join-Path "dist" "$Asset.zip"
Compress-Archive -Path $Package -DestinationPath $Archive
$Hash = (Get-FileHash -Algorithm SHA256 $Archive).Hash.ToLowerInvariant()
"$Hash $Asset.zip" | Set-Content -NoNewline "$Archive.sha256"
- uses: actions/upload-artifact@v4
with:
name: release-windows
path: |
dist/simplex-tui-windows-x86_64.zip
dist/simplex-tui-windows-x86_64.zip.sha256
if-no-files-found: error
publish:
name: Publish GitHub release
needs: [build-linux, package-macos, build-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: release-*
path: dist
merge-multiple: true
- name: Create release through the GitHub API
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ inputs.tag || github.ref_name }}
run: |
gh release create "$TAG" dist/* \
--verify-tag \
--title "simplex-tui $TAG" \
--generate-notes