-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change zigbuild name try without caching and install zigbuild fix cargo install zigbuild try with caching cache zigbuild install
- Loading branch information
Showing
1 changed file
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Build and release with Zigbuild | ||
|
||
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: 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 }} | ||
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 }} | ||
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 |