fix(substitute): literals and function definitions #217
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
# whether artifacts should be published to ci-job (previewed) or as release | |
preview: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
jobs: | |
build: | |
name: Build | |
env: | |
CARGO: cargo # 'cross' used for 32-bit and big-endian systems | |
RUST_BACKTRACE: 1 # emit backtrace on panics | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # don't fail other jobs if one fails | |
matrix: | |
build: [x86_64-linux, x86_64-macos, x86_64-windows] | |
include: | |
- build: x86_64-linux | |
os: ubuntu-latest | |
rust: stable | |
target: x86_64-unknown-linux-musl | |
cross: false | |
- build: aarch64-linux | |
os: ubuntu-latest | |
rust: stable | |
target: aarch64-unknown-linux-musl | |
cross: true | |
- build: riscv64-linux | |
os: ubuntu-latest | |
rust: stable | |
target: riscv64gc-unknown-linux-gnu | |
cross: true | |
- build: x86_64-macos | |
os: macos-latest | |
rust: stable | |
target: x86_64-apple-darwin | |
cross: false | |
- build: x86_64-windows | |
os: windows-latest | |
rust: stable | |
target: x86_64-pc-windows-msvc | |
cross: false | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Download grammars | |
uses: actions/download-artifact@v3 | |
# The rust-toolchain action ignores rust-toolchain.toml files. | |
# Removing this before building with cargo ensures that the rust-toolchain | |
# is considered the same between installation and usage. | |
- name: Remove the rust-toolchain.toml file | |
run: | | |
touch rust-toolchain.toml # create if it doesn't exist | |
rm rust-toolchain.toml | |
- name: Install ${{ matrix.rust }} toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ matrix.rust }} | |
target: ${{ matrix.target }} | |
- name: Install Cross | |
if: "matrix.cross" | |
run: | | |
cargo install cross | |
echo "CARGO=cross" >> $GITHUB_ENV | |
- name: Show command used for Cargo | |
run: | | |
echo "build command: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}" | |
- name: Run cargo test | |
if: "!matrix.skip_tests" | |
run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace | |
- name: Set profile.release.strip = true | |
shell: bash | |
run: | | |
mkdir -p .cargo | |
cat >> .cargo/config.toml <<EOF | |
[profile.release] | |
strip = true | |
EOF | |
- name: Build release binary | |
run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }} | |
- name: Build archive | |
shell: bash | |
run: | | |
mkdir -p dist | |
ls ./target/${{ matrix.target }}/release/r* | |
cp ./target/${{ matrix.target }}/release/r dist/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: r-${{ matrix.build }} | |
path: dist | |
publish: | |
name: Publish | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
- name: Check Artifacts | |
shell: bash | |
run: | | |
ls . | |
- name: Upload binaries to release | |
uses: softprops/action-gh-release@v1 | |
if: env.preview == 'false' | |
with: | |
files: r-* | |
- name: Upload binaries as artifact | |
uses: actions/upload-artifact@v3 | |
if: env.preview == 'true' | |
with: | |
name: release | |
path: r-* |