esp-web-flash/.github/workflows/package.yml
2022-05-26 15:16:16 +02:00

53 lines
1.3 KiB
YAML

name: Package
on:
workflow_call:
inputs:
runs_on:
required: true
type: string
target:
required: true
type: string
extension:
default: ""
type: string
jobs:
build:
name: Build static binaries
runs-on: ${{ inputs.runs_on }}
steps:
- name: Change apt mirror and install dependencies
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/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ inputs.target }}
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all --target ${{ inputs.target }}
- uses: papeloto/action-zip@v1
with:
files: target/${{ inputs.target }}/release/web-flash${{ inputs.extension }}
recursive: true
dest: web-flash-${{ inputs.target }}.zip
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: web-flash-${{ inputs.target }}.zip
tag: ${{ github.ref }}