Skip to content

iced update

iced update #39

Workflow file for this run

name: Build and Make release
on:
push:
branches:
- "master"
env:
CARGO_TERM_COLOR: always
jobs:
build_linux:
runs-on: ubuntu-22.04
steps:
- uses: hecrj/setup-rust-action@v1
- name: Install cargo-deb
run: cargo install cargo-deb
- uses: actions/checkout@master
- name: Install dependencies
run: |
export DEBIAN_FRONTED=noninteractive
sudo apt-get -qq update
sudo apt-get install -y libxkbcommon-dev
- name: Build iced_text_input_sample binary
run: cargo build --release
- name: Pack iced_text_input_sample .deb package
run: cargo deb --no-build --profile release --package iced_text_input_sample
- name: prepare for pickup package
run: mv target/debian/*.deb target/debian/sample_amd64.deb
- name: prepare for pickup package
run: mv target/release/iced_text_input_sample target/release/sample_linux_amd64
- name: Archive iced_text_input_sample binary
uses: actions/upload-artifact@v3
with:
name: sample-linux-x64
path: target/release/sample_linux_amd64
- name: Archive .deb binary
uses: actions/upload-artifact@v3
with:
name: sample-ubuntu2204-x64
path: target/debian/sample_amd64.deb
build_windows:
runs-on: windows-latest
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@master
- name: Enable static CRT linkage
run: |
mkdir .cargo
echo '[target.x86_64-pc-windows-msvc]' >> .cargo/config
echo 'rustflags = ["-Ctarget-feature=+crt-static"]' >> .cargo/config
- name: Run the application without starting the shell
run: |
sed -i '1 i\#![windows_subsystem = \"windows\"]' src/main.rs
- name: Build iced_text_input_sample binary
run: cargo build --release
- name: Rename iced_text_input_sample
run: ren target/release/iced_text_input_sample.exe sample.exe
- name: Archive iced_text_input_sample binary
uses: actions/upload-artifact@v3
with:
name: sample-windows-x64
path: target/release/sample.exe
build_macos:
runs-on: macos-latest
steps:
- uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@master
- name: Build iced_text_input_sample binary
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
run: cargo build --release
- name: Rename binary
run: mv target/release/iced_text_input_sample target/release/sample_macos
- name: Open binary via double-click
run: chmod +x target/release/sample_macos
- name: Archive iced_text_input_sample binary
uses: actions/upload-artifact@v3
with:
name: sample-macos
path: target/release/sample_macos
publish_binaries:
name: Publish binaries.
runs-on: ubuntu-latest
needs: [build_windows, build_linux, build_macos]
steps:
- name: checkout
uses: actions/checkout@master
- name: chmod
run: chmod +x .github/extract_hash.sh
- name: extract hash
run: .github/extract_hash.sh
- name: upload hash
uses: actions/upload-artifact@v3
with:
name: iced_hash
path: tmp1.txt
- name: set hash
run: echo "hash=$(cat tmp1.txt)" >> $GITHUB_ENV
- name: accept binary from windows builder
uses: actions/download-artifact@v3
with:
name: sample-windows-x64
- name: accept binary from linux builder
uses: actions/download-artifact@v3
with:
name: sample-linux-x64
- name: accept binary from linux builder .deb archive
uses: actions/download-artifact@v3
with:
name: sample-ubuntu2204-x64
- name: accept binary from windows builder
uses: actions/download-artifact@v3
with:
name: sample-macos
- name: list files
run: ls -l
- id: release_binary
uses: softprops/action-gh-release@v1
with:
name: Build with commit ${{env.hash}}
tag_name: v${{github.run_number}}
draft: false
body: sample release
generate_release_notes: true
append_body: true
files: |
sample_macos
sample.exe
sample_amd64.deb
sample_linux_amd64
- name: print uploaded files
run: echo '${{steps.release_binary.outputs.asset}}'