Skip to content

refs/tags/v0.0.28

refs/tags/v0.0.28 #38

name: Build and release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
dry_run:
type: boolean
description: 'Dry Run'
required: false
default: false
tag:
description: 'Tag'
required: true
default: 'v0.0.0'
run-name: ${{ github.event.inputs.dry_run == 'true' && 'Dry run' || github.event.inputs.tag || github.ref }}
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache cargo bin
uses: actions/cache@v2
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: jethrodaniel/setup-zig@fix-caching
with:
version: 0.12.0-dev.903+7aa85691b
- name: Install Arm compile target
run: rustup target add armv7-unknown-linux-gnueabihf
- name: Install Zigbuild
run: |
if ! command -v cargo-zigbuild &> /dev/null
then
cargo install cargo-zigbuild
fi
- name: Build
run: cargo zigbuild --target armv7-unknown-linux-gnueabihf --release
- name: Create Release
if: ${{ !github.event.inputs.dry_run || github.event.inputs.dry_run == 'false' }}
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/create-release@v1
with:
tag_name: ${{ github.event.inputs.tag || github.ref }}
release_name: Release ${{ github.event.inputs.tag || github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
if: ${{ !github.event.inputs.dry_run || github.event.inputs.dry_run == 'false' }}
id: upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./target/armv7-unknown-linux-gnueabihf/release/infoskjerm
asset_name: infoskjerm
asset_content_type: application/zip