-
-
Notifications
You must be signed in to change notification settings - Fork 160
137 lines (113 loc) · 4.07 KB
/
release-versoview.yml
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
name: Release VersoView
on:
workflow_dispatch:
env:
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nixbuild/nix-quick-install-action@v28
- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
paths: |
~/.cargo
target/release/
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', 'Cargo.lock', 'Cargo.toml') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824
- name: Add Nix channel
run: |
nix-channel --add https://nixos.org/channels/nixos-24.05 nixpkgs
nix-channel --update nixpkgs
- name: Build
run: nix-shell shell.nix --run 'cargo build --release'
- name: Make archive
run: nix-shell shell.nix --run 'cd ./target/release && tar -czvf verso-x86_64-unknown-linux-gnu.tar.gz versoview'
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: verso-x86_64-unknown-linux-gnu
path: ./target/release/verso-x86_64-unknown-linux-gnu.tar.gz
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install mako
run: python -m pip install mako
- name: Install scroop
uses: MinoruSekine/setup-scoop@v3
- name: Install dependencies
run: |
scoop install llvm cmake
- name: Build
env:
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: "sccache"
run: cargo build --release
- name: Make archive
working-directory: ./target/release
run: tar -czvf verso-x86_64-pc-windows-msvc.tar.gz versoview.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: verso-x86_64-pc-windows-msvc
path: ./target/release/verso-x86_64-pc-windows-msvc.tar.gz
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install mako
run: python -m pip install mako
- name: Install dependencies
run: |
brew install cmake
curl https://gstreamer.freedesktop.org/data/pkg/osx/1.24.6/gstreamer-1.0-1.24.6-universal.pkg -o runtime.pkg
sudo installer -pkg runtime.pkg -target /
curl https://gstreamer.freedesktop.org/data/pkg/osx/1.24.6/gstreamer-1.0-devel-1.24.6-universal.pkg -o develop.pkg
sudo installer -pkg develop.pkg -target /
- name: Build
env:
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: "sccache"
run: cargo build --release
- name: Make archive
working-directory: ./target/release
run: tar -czvf verso-aarch64-apple-darwin.tar.gz versoview
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: verso-aarch64-apple-darwin
path: ./target/release/verso-aarch64-apple-darwin.tar.gz
publish-release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-mac]
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: artifacts
- name: Publish release
run: |
RELEASE_TAG=versoview-v$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "versoview") | .version')
git fetch --tags --quiet
if ! git show-ref --tags --verify --quiet "refs/tags/${RELEASE_TAG}" ; then
gh release create ${RELEASE_TAG} ./artifacts/*.tar.gz
fi