mirror of
https://github.com/esp-rs/espflash.git
synced 2026-03-21 06:43:58 +00:00
* ci: ✨ Add Rasberry CI * ci: 🐛 Fix typo * ci: 🐛 Fix args order * ci: 🐛 Fix args order * chore: ⚡️ Split Raspberry CI into a file * refactor: ♻️ Split Raspberry CI files into CI and Package * ci: 🐛 Add features arg to clippy check * ci: ⚡️ Remove fmt check
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: Package
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
runs_on:
|
|
required: true
|
|
type: string
|
|
target:
|
|
required: true
|
|
type: string
|
|
extension:
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
publish-release:
|
|
runs-on: ${{ inputs.runs_on }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
crate: ["espflash", "cargo-espflash"]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: ${{ inputs.target }}
|
|
override: true
|
|
- uses: Swatinem/rust-cache@v1
|
|
- name: Build dependencies for other ubuntu targets
|
|
if: inputs.runs_on == 'ubuntu-latest'
|
|
run: |
|
|
sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list
|
|
sudo apt-get update
|
|
sudo apt-get install musl-tools libudev-dev
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --release --all --target ${{ inputs.target }}
|
|
- name: Compress (Unix)
|
|
if: ${{ inputs.runs_on != 'windows-latest' }}
|
|
run: zip -j ${{ matrix.crate }}-${{ inputs.target }}.zip target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }}
|
|
- name: Compress (Windows)
|
|
if: ${{ inputs.runs_on == 'windows-latest' }}
|
|
run: Compress-Archive target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }} ${{ matrix.crate }}-${{ inputs.target }}.zip
|
|
- uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ${{ matrix.crate }}-${{ inputs.target }}.zip
|
|
tag: ${{ github.ref }}
|