Merge pull request #17 from maotovisk/dev #13
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
name: "publish" | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-binaries: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- os: ubuntu-latest | |
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@v3 | |
- name: setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: setup node | |
uses: actions/setup-node@v3 | |
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 only) | |
if: matrix.platform.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf | |
- name: Install node dependencies | |
run: pnpm install | |
- uses: JonasKruckenberg/[email protected] | |
id: tauri_build | |
with: | |
target: ${{ matrix.platform.rust_target }} | |
# The artifacts output can now be used to upload the artifacts | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}" | |
publish: | |
needs: build-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Download the previously uploaded artifacts | |
- uses: actions/download-artifact@v3 | |
id: download | |
with: | |
name: artifacts | |
path: artifacts | |
# And create a release with the artifacts attached | |
- name: "create release" | |
uses: softprops/action-gh-release@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
with: | |
tag_name: v__VERSION__ | |
name: Release v__VERSION__ | |
body: "This is a automated release." | |
prerelease: false | |
draft: true | |
files: ./artifacts/**/* |