Skip to content

chore(release): 0.0.7 #6

chore(release): 0.0.7

chore(release): 0.0.7 #6

Workflow file for this run

name: Release and publish
on:
push:
tags:
- "v*"
jobs:
create-release:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create-release.outputs.result }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: get version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
- name: create release
id: create-release
uses: actions/github-script@v6
with:
script: |
const { data } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: `hackdesk-v${process.env.PACKAGE_VERSION}`,
name: `HackDesk v${process.env.PACKAGE_VERSION}`,
body: 'Take a look at the assets to download and install this app.',
draft: true,
prerelease: false
})
return data.id
build-app:
needs: create-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- build: linux
os: ubuntu-latest
arch: x86_64
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
arch: x86_64
target: x86_64-apple-darwin
- build: macos
os: macos-latest
arch: aarch64
target: aarch64-apple-darwin
- build: windows
os: windows-latest
arch: x86_64
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Add rust target
run: rustup target add ${{ matrix.target }}
- name: Cache Rust
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: Install Pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install frontend deps
run: pnpm install --frozen-lockfile
- uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}
args: --target ${{ matrix.target }}
publish-release:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [create-release, build-app]
steps:
- name: publish release
id: publish-release
uses: actions/github-script@v6
env:
release_id: ${{ needs.create-release.outputs.release_id }}
with:
script: |
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: process.env.release_id,
draft: false,
prerelease: false
})