Files
espflash/.github/workflows/package.yml
Sergio Gasquez Arcos 1367675735 Add raspberry feature checks in CI. (#255)
* 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
2022-10-05 07:45:32 -07:00

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 }}