-
Notifications
You must be signed in to change notification settings - Fork 22
161 lines (141 loc) · 4.45 KB
/
rust.yml
File metadata and controls
161 lines (141 loc) · 4.45 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
name: Rust
on:
workflow_dispatch:
inputs:
RUST_TOOLCHAIN:
description: RUST_TOOLCHAIN (stable or 1.89)
default: "1.89"
required: true
schedule:
- cron: "0 0 1 * *"
push:
paths-ignore:
- 'README.md'
# - '.github/**'
branches: [ master ]
pull_request:
paths-ignore:
- 'README.md'
- '.github/**'
branches: [ master ]
env:
CARGO_TERM_COLOR: always
VCPKG_COMMIT_ID: 365f6444ab40ee87c73c947b475b3a267b3cb77c
TAG_NAME: latest
VERSION: "1.1.4"
jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macOS-latest, macOS-15-intel]
include:
- name: ubuntu
os: ubuntu-22.04
artifact_name: target/release/RustPlayer
asset_name: RustPlayer-linux-amd64
- name: macos
os: macOS-latest
artifact_name: target/release/RustPlayer
asset_name: RustPlayer-macos-arm64
- name: macos
os: macOS-15-intel
artifact_name: target/release/RustPlayer
asset_name: RustPlayer-macos-x64
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
# - name: patch dynamic build
# run: git apply dynamic-lib.patch
- run: rustup toolchain install ${{ inputs.RUST_TOOLCHAIN }} --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Install macos deps
if: matrix.name == 'macos'
run: |
brew update
brew install nasm yasm
- name: Install cargo bundle and deps
if: matrix.name == 'ubuntu'
shell: bash
run: |
sudo apt update -y
sudo apt-get install -y pkg-config libasound2-dev libssl-dev libclang-dev nasm yasm
pushd /tmp
git clone https://github.com/burtonageo/cargo-bundle
pushd cargo-bundle
cargo install --path .
popd
popd
- name: build RustPlayer for macOS
if: matrix.name == 'macos'
run: cargo build --release
- name: build RustPlayer for Linux
if: matrix.name == 'ubuntu'
run: cargo bundle --release
- name: bundle RustPlayer for macOS
if: matrix.name == 'macos'
run: |
# npm install --global create-dmg
# for name in target/release/bundle/osx/*.app; do
# create-dmg $name || true
# done
mv target/release/rustplayer ${{ matrix.asset_name }}-${{ env.VERSION }}.out
- name: Publish Release for linux
if: matrix.name == 'ubuntu'
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ env.TAG_NAME }}
files: |
target/release/bundle/deb/*.deb
- name: Publish Release for macos
if: matrix.name == 'macos'
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ env.TAG_NAME }}
files: |
${{ matrix.asset_name }}-${{ env.VERSION }}.out
build-on-windows:
runs-on: windows-2022
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- { sys: msvc, env: x86_64, artifact_name: target/release/RustPlayer.exe , asset_name: RustPlayer-windows-x86_64.exe }
# - { sys: mingw32, env: i686, artifact_name: target/release/RustPlayer.exe , asset_name: RustPlayer-windows-x86.exe }
# - { sys: ucrt64, env: ucrt-x86_64 } # Experimental!
# - { sys: clang64, env: clang-x86_64 } # Experimental!
# defaults:
# run:
# shell: msys2 {0}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: ilammy/msvc-dev-cmd@v1
- run: rustup toolchain install ${{ inputs.RUST_TOOLCHAIN }} --profile minimal
- uses: Swatinem/rust-cache@v2
- name: setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
- name: build RustPlayer
run: |
vcpkg install ffmpeg:x64-windows-static-md
cargo build --release
- name: rename
shell: bash
run: |
mv target/release/rustplayer.exe target/release/rustplayer-${{ matrix.sys }}-${{ matrix.env }}-${{ env.VERSION }}.exe
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ env.TAG_NAME }}
files: |
target/release/rustplayer*.exe