forked from gamozolabs/pdblister
-
Notifications
You must be signed in to change notification settings - Fork 11
76 lines (68 loc) · 2.25 KB
/
release.yaml
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
# Based on example from: https://github.com/taiki-e/upload-rust-binary-action
name: Release
permissions:
contents: write
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
CARGO_INCREMENTAL: 0
# CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS:
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash --noprofile --norc -CeEuxo pipefail {0}
jobs:
create-release:
if: github.repository_owner == 'microsoft'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
# (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
name: ${{ matrix.target }}
if: github.repository_owner == 'microsoft'
needs: create-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install latest stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- run: printf '%s\n' "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >>"${GITHUB_ENV}"
if: contains(matrix.target, '-windows-msvc')
- run: printf '%s\n' "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static -C link-self-contained=yes" >>"${GITHUB_ENV}"
if: contains(matrix.target, '-linux-musl')
# https://doc.rust-lang.org/rustc/platform-support.html
- run: printf 'MACOSX_DEPLOYMENT_TARGET=10.12\n' >>"${GITHUB_ENV}"
if: matrix.target == 'x86_64-apple-darwin'
- run: printf 'MACOSX_DEPLOYMENT_TARGET=11.0\n' >>"${GITHUB_ENV}"
if: matrix.target == 'aarch64-apple-darwin' || matrix.target == 'universal-apple-darwin'
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: pdblister
target: ${{ matrix.target }}
tar: all
zip: windows
token: ${{ secrets.GITHUB_TOKEN }}