-
Notifications
You must be signed in to change notification settings - Fork 12
90 lines (75 loc) · 2.08 KB
/
Copy pathrelease.yml
File metadata and controls
90 lines (75 loc) · 2.08 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
name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install FUSE (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libfuse3-dev fuse3
- name: Install FUSE (macOS)
if: runner.os == 'macOS'
run: brew install --cask macfuse
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
run: |
tar czf branchfs-${{ github.ref_name }}-${{ matrix.target }}.tar.gz \
-C target/${{ matrix.target }}/release branchfs
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: branchfs-${{ matrix.target }}
path: branchfs-*.tar.gz
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*.tar.gz
generate_release_notes: true
publish:
name: Publish to crates.io
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install FUSE
run: |
sudo apt-get update
sudo apt-get install -y libfuse3-dev fuse3
- name: Publish
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}