Skip to content

Dry run

Dry run #16

name: Build and release
on:
push:
tags:
- 'v*' # Push events matching v*, i.e. v1.0, v20.15.10
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: Install Cross
run: cargo install cross
- name: Build
run: cross build --release --target=armv7-unknown-linux-gnueabihf
- name: Create Release
if: ${{ !github.event.inputs.dry_run }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 }}
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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