Skip to content

Commit 756c088

Browse files
committed
ci: generate & upload gif along with releases
1 parent 015efb3 commit 756c088

File tree

2 files changed

+124
-75
lines changed

2 files changed

+124
-75
lines changed

.github/workflows/demo.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
auto-release:
12+
build:
1313
runs-on: ubuntu-24.04
1414
steps:
1515
- uses: actions/checkout@v4
@@ -22,6 +22,27 @@ jobs:
2222
env:
2323
CXX: g++-14
2424

25+
- name: Upload build artifact
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: cabin-binary
29+
path: bin/cabin
30+
31+
package:
32+
needs: build
33+
runs-on: ubuntu-24.04
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Download build artifact
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: cabin-binary
41+
path: bin/
42+
43+
- name: Make binary executable
44+
run: chmod +x bin/cabin
45+
2546
- name: Install nFPM
2647
run: |
2748
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
@@ -38,6 +59,107 @@ jobs:
3859
env:
3960
CABIN_VERSION: ${{ github.ref_name }}
4061

62+
- name: Upload package artifacts
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: packages
66+
path: |
67+
*.deb
68+
*.rpm
69+
70+
demo:
71+
needs: build
72+
runs-on: ubuntu-24.04
73+
env:
74+
CXX: g++-13
75+
steps:
76+
- uses: actions/checkout@v4
77+
78+
- name: Download build artifact
79+
uses: actions/download-artifact@v4
80+
with:
81+
name: cabin-binary
82+
path: bin/
83+
84+
- name: Make binary executable
85+
run: chmod +x bin/cabin
86+
87+
- name: Setup dependencies
88+
uses: ./.github/actions/setup-ubuntu-deps
89+
90+
- name: Print versions
91+
run: make versions
92+
93+
- name: Install Cabin
94+
run: |
95+
make PREFIX="$HOME/.local" install
96+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
97+
98+
- name: Install ttyd
99+
run: |
100+
wget https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 -P "$HOME/.local/bin"
101+
mv "$HOME/.local/bin/ttyd.x86_64" "$HOME/.local/bin/ttyd"
102+
chmod +x "$HOME/.local/bin/ttyd"
103+
104+
- name: Install ffmpeg
105+
run: sudo apt-get update && sudo apt-get install -y ffmpeg
106+
107+
- uses: actions/setup-go@v5
108+
with:
109+
go-version: 'stable'
110+
111+
- name: Install VHS
112+
run: go install github.com/charmbracelet/vhs@latest
113+
114+
- name: Install Nerd Font
115+
run: |
116+
mkdir -p ~/.local/share/fonts
117+
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraCode.zip
118+
unzip FiraCode.zip -d ~/.local/share/fonts/
119+
fc-cache -fv
120+
121+
- name: Install Zsh
122+
run: sudo apt update && sudo apt install -y zsh
123+
124+
- name: Install zsh-syntax-highlighting
125+
run: |
126+
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/z
127+
echo 'source ~/z/zsh-syntax-highlighting.zsh' >> ~/.zshrc
128+
129+
- name: Install Starship
130+
run: |
131+
curl -sS https://starship.rs/install.sh | sh -s -- -y
132+
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
133+
134+
- name: Move demo.tape
135+
run: mv demo.tape ${{ runner.temp }}
136+
137+
- name: Generate demo.gif
138+
run: vhs demo.tape
139+
working-directory: ${{ runner.temp }}
140+
141+
- name: Upload demo artifact
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: demo-gif
145+
path: ${{ runner.temp }}/demo.gif
146+
147+
release:
148+
needs: [package, demo]
149+
runs-on: ubuntu-24.04
150+
steps:
151+
- uses: actions/checkout@v4
152+
153+
- name: Download package artifacts
154+
uses: actions/download-artifact@v4
155+
with:
156+
name: packages
157+
158+
- name: Download demo artifact
159+
uses: actions/download-artifact@v4
160+
with:
161+
name: demo-gif
162+
41163
- name: Release
42164
uses: softprops/action-gh-release@v2
43165
with:
@@ -46,6 +168,7 @@ jobs:
46168
files: |
47169
*.deb
48170
*.rpm
171+
demo.gif
49172
body: |
50173
:sparkling_heart: I maintain **Cabin** in my spare time. Buy me a coffee on [GitHub Sponsors](https://github.com/sponsors/ken-matsui) so I can keep shipping features!
51174

0 commit comments

Comments
 (0)