-
Notifications
You must be signed in to change notification settings - Fork 54
85 lines (76 loc) · 2.39 KB
/
release.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
name: Release
on:
push:
tags: ['v[0-9]+.*']
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
jobs:
create-release:
if: github.repository_owner == 'openrr'
runs-on: ubuntu-20.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies (linux)
run: |
sudo apt-get update
sudo apt-get install xorg-dev libglu1-mesa-dev
- run: cargo package
- uses: taiki-e/create-gh-release-action@v1
with:
branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
upload-assets:
name: upload-assets (${{ matrix.os }})
if: github.repository_owner == 'openrr'
needs: [create-release]
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- target: x86_64-apple-darwin
os: macos-13
- target: aarch64-apple-darwin
os: macos-14
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies (linux)
run: |
sudo apt-get update
sudo apt-get install xorg-dev libglu1-mesa-dev
if: startsWith(matrix.os, 'ubuntu')
- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >>"${GITHUB_ENV}"
if: contains(matrix.target, '-windows-msvc')
# https://doc.rust-lang.org/rustc/platform-support.html
- run: echo "MACOSX_DEPLOYMENT_TARGET=10.12" >>"${GITHUB_ENV}"
if: matrix.target == 'x86_64-apple-darwin'
- run: echo "MACOSX_DEPLOYMENT_TARGET=11.0" >>"${GITHUB_ENV}"
if: matrix.target == 'aarch64-apple-darwin'
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: urdf-viz
target: ${{ matrix.target }}
# TODO: Should we enable assimp feature for pre-built binary?
# all-features: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_PROFILE_RELEASE_LTO: true