Merge pull request #559 from trobonox/main #56
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
# 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-latest | |
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: 18 | |
- 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 | |
- 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 |