Skip to content

ci(deps): update taiki-e/install-action action to v2.47.7 #1849

ci(deps): update taiki-e/install-action action to v2.47.7

ci(deps): update taiki-e/install-action action to v2.47.7 #1849

Workflow file for this run

name: build
on:
push:
branches:
- 'main'
pull_request:
workflow_call:
inputs:
tag-name:
required: true
type: string
jobs:
build:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
profile: ${{ github.ref_name == github.event.repository.default_branch && fromJson('["dev", "release"]') || fromJson('["dev"]') }}
platform:
- target: aarch64-unknown-linux-musl
os: ubuntu-22.04
command: cross
- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
command: cargo
- target: aarch64-apple-darwin
os: macos-14
command: cargo
- target: x86_64-apple-darwin
os: macos-14
command: cargo
- target: x86_64-pc-windows-msvc
os: windows-2022
command: cargo
runs-on: ${{ matrix.platform.os }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
defaults:
run:
shell: bash -xe {0}
steps:
- name: Install musl tools
if: matrix.platform.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get install -y musl-tools --no-install-recommends
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
filter: tree:0
fetch-depth: 0
- run: |
rustup target add ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
key: ${{ matrix.profile }}-${{ matrix.platform.target }}
- name: Install cross
if: ${{ matrix.platform.command == 'cross' }}
uses: taiki-e/install-action@b8f3ee33546bb9aa3e4ca53cd7d6d85a7e18a0c9 # v2.46.14
with:
tool: cross
- run: ${{ matrix.platform.command }} build --locked --bins ${{ matrix.profile == 'release' && '--release' || '' }} --target ${{ matrix.platform.target }}
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ${{ matrix.profile }}-${{ matrix.platform.target }}
path: |
target/${{ matrix.platform.target }}/debug/pcsc-rs
target/${{ matrix.platform.target }}/debug/pcsc-rs.exe
target/${{ matrix.platform.target }}/release/pcsc-rs
target/${{ matrix.platform.target }}/release/pcsc-rs.exe
if-no-files-found: error
- name: Upload to release
if: ${{ inputs.tag-name && matrix.profile == 'release' }}
working-directory: target/${{ matrix.platform.target }}/release/
run: |
if [ -e pcsc-rs.exe ]; then
filename="pcsc-rs-${{ inputs.tag-name }}-${{ matrix.platform.target }}.exe"
mv pcsc-rs.exe "$filename"
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.platform.target }} --clobber
else
filename="pcsc-rs-${{ inputs.tag-name }}-${{ matrix.platform.target }}"
mv pcsc-rs "$filename"
gh release upload ${{ inputs.tag-name }} "$filename"#${{ matrix.platform.target }} --clobber
fi