Skip to content

Update release.yml

Update release.yml #60

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2022-2024 trobonox <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
name: 'Release App'
on:
push:
branches:
- release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-binaries:
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-22.04
rust_target: x86_64-unknown-linux-gnu
- os: macos-13
rust_target: x86_64-apple-darwin
- os: macos-latest
rust_target: aarch64-apple-darwin
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- name: Output info
run: echo ${{ matrix.platform.os }} ${{ matrix.platform.rust_target }}
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: 'Setup Rust'
uses: actions-rs/toolchain@v1
with:
default: true
override: true
profile: minimal
toolchain: stable
target: ${{ matrix.platform.rust_target }}
- uses: Swatinem/rust-cache@v2
- name: install dependencies (ubuntu x86_64)
if: matrix.platform.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
- name: Build Frontend
run: yarn && yarn generate
- name: Install Tauri CLI
if: matrix.platform.rust_target == 'aarch64-apple-darwin'
run: yarn add @tauri-apps/cli-darwin-arm64
- uses: JonasKruckenberg/[email protected]
id: tauri_build
with:
target: ${{ matrix.platform.rust_target }}
# The `artifacts` output can now be used by a different action to upload the artifacts
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"
publish:
needs: build-binaries
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
# Download the previously uploaded artifacts
- uses: actions/download-artifact@v4
id: download
with:
name: artifacts
path: artifacts
# And create a release with the artifacts attached
- name: 'create release'
uses: softprops/action-gh-release@master
id: release
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
name: "Kanri vx.x.x"
draft: true
files: ./artifacts/**/*
publish-kanri-arm:
needs: publish
strategy:
matrix:
arch: [arm64, armv7]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: yarn install
- name: Build for ${{ matrix.arch }}
run: yarn run init:${{matrix.arch}} && yarn run build:${{matrix.arch}}
- name: Upload Multiple Release Assets
uses: NBTX/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.publish.outputs.upload_url }}
targets: ./src-tauri/target/*/release/bundle/deb/*.deb