Skip to content

deps: lock file maintenance #1623

deps: lock file maintenance

deps: lock file maintenance #1623

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-gnu
os: ubuntu-22.04
command: cross
- target: aarch64-unknown-linux-musl
os: ubuntu-22.04
command: cross
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
command: cargo
- 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
- target: x86_64-pc-windows-gnu
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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
filter: tree:0
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ 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@a3df29458daa5c62abace1e6b358018bed57d5b4 # v2.44.43
with:
tool: cross
- run: ${{ matrix.platform.command }} build --locked ${{ 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