-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
86 lines (79 loc) · 2.98 KB
/
action.yml
File metadata and controls
86 lines (79 loc) · 2.98 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
name: "Rust simple release"
description: "Extremely simple cross-platform release for your rust project! (with openssl hacked)"
# See: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#branding
branding:
icon: "slash"
color: "green"
inputs:
package:
description: "package to build (you can only choose one)"
required: false
default: ""
targets:
description: "targets to build, split by comma(,)"
required: false
default: ""
bins:
description: "Binary output names, split by comma(,). If not set, it will build all bins in the current package."
required: false
default: ""
lib:
description: "whether to build lib in the current package"
required: false
default: ""
features:
description: "features to build, split by comma(,)"
required: false
default: ""
files_to_pack:
description: "relative file paths to compress to assets, split by comma(,)"
required: false
default: ""
token:
description: >
GitHub token for creating GitHub Releases.
If not set this option, the GITHUB_TOKEN environment variable will be used.
required: true
release_options:
description: "gh release create command options"
required: false
default: ""
runs:
using: "composite"
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- uses: cargo-bins/cargo-binstall@main
# - name: Setup sccache-cache
# uses: mozilla-actions/sccache-action@v0.0.7
# do not use nightly zig: https://github.com/rust-cross/cargo-zigbuild/issues/290
- uses: mlugg/setup-zig@v2
if: runner.os != 'Windows' && runner.os != 'macOS'
# https://github.com/sfackler/rust-openssl/issues/2149#issuecomment-2014064057
- name: Set Perl environment variables
if: runner.os == 'Windows'
# https://docs.github.com/zh/actions/use-cases-and-examples/building-and-testing/building-and-testing-powershell
shell: pwsh
run: |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: install "toml" python package
shell: bash
run: pip install toml
- shell: bash
run: python "${GITHUB_ACTION_PATH:?}/main.py"
env:
INPUT_PACKAGE: ${{ inputs.package }}
INPUT_TARGETS: ${{ inputs.targets }}
INPUT_BINS: ${{ inputs.bins }}
INPUT_LIB: ${{ inputs.lib }}
INPUT_FEATURES: ${{ inputs.features }}
INPUT_FILES_TO_PACK: ${{ inputs.files_to_pack }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ inputs.token }}
INPUT_RELEASE_OPTIONS: ${{ inputs.release_options }}
# Cannot compile zstd-sys on ubuntu-latest: `SCCACHE_START_SERVER=1` can't be used with other commands
# SCCACHE_GHA_ENABLED: true
# RUSTC_WRAPPER: "sccache"