Skip to content

Commit 0789167

Browse files
committed
Add workflow to build and upload assets
1 parent 3c58555 commit 0789167

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/build-assets.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build Assets
2+
on:
3+
workflow_dispatch:
4+
5+
env:
6+
CARGO_TERM_COLOR: always
7+
8+
jobs:
9+
build-assets:
10+
name: Build (${{ matrix.os }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
os:
16+
- macOS-latest
17+
- ubuntu-latest
18+
- windows-latest
19+
20+
steps:
21+
- uses: actions/checkout@v6
22+
23+
- run: mkdir dist
24+
- name: Build
25+
run: cargo build --release
26+
- name: Upload (Unix)
27+
if: ${{ runner.os != 'Windows' }}
28+
env:
29+
BUILD_TARGET: ${{ runner.os }}-${{ runner.arch }}
30+
run: |
31+
tar -C target/release/ -czvf "fancy-tree-$BUILD_TARGET.tar.gz" fancy-tree
32+
mv "fancy-tree-$BUILD_TARGET.tar.gz" dist/
33+
- name: Upload (Windows)
34+
if: ${{ runner.os == 'Windows' }}
35+
run: |
36+
zip -v -9 "fancy-tree-$BUILD_TARGET.zip" target/release/fancy-tree.exe
37+
mv "fancy-tree-$BUILD_TARGET.zip" dist/
38+
39+
- uses: actions/upload-artifact@v6
40+
id: upload-artifact
41+
with:
42+
name: ${{ runner.os }}-${{ runner.arch }}
43+
path: dist/*
44+
if-no-files-found: error
45+
46+
- run: echo "Uploaded artifact to ${{ steps.upload-artifact.outputs.artifact-url }}"

0 commit comments

Comments
 (0)