Skip to content

Commit

Permalink
ci(fix): add release workflow with tauri updater (#7)
Browse files Browse the repository at this point in the history
Description
Add release workflow with tauri updater

Motivation and Context
Having a tauri application that builds and has updater function

How Has This Been Tested?
Mostly built in local fork.

What process can a PR reviewer use to test or verify this change?
---

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
leet4tari authored Jul 30, 2024
1 parent f915a68 commit cbc5ae1
Show file tree
Hide file tree
Showing 4 changed files with 376 additions and 17 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
name: Release

'on':
push:
paths-ignore:
- '**/*.md'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- 'main'
- 'build-*'
workflow_dispatch:

concurrency:
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/main' }}

permissions: {}

jobs:
builds:
name: Building ${{ matrix.platform }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'ubuntu-20.04'
args: ''
- platform: 'windows-2019'
args: ''
- platform: 'macos-latest'
args: '--verbose --target universal-apple-darwin'

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Node.js setup
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'

- name: Rust setup (macOS)
if: startsWith(runner.os,'macOS')
uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-apple-darwin,x86_64-apple-darwin

- name: Rust setup (linux)
if: startsWith(runner.os,'Linux')
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-unknown-linux-gnu

- name: Cache cargo files and outputs
if: ${{ ( ! startsWith(github.ref, 'refs/tags/v') ) }}
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- name: Install dependencies (linux)
if: startsWith(runner.os,'Linux')
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --assume-yes \
libwebkit2gtk-4.0-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf
- name: Install dependencies (node)
run: |
npm --version
npm install
- name: Build Tauri apps
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
tagName: tari_universe-v__VERSION__
releaseName: 'Tari Universe v__VERSION__'
releaseBody: 'Tari Universe - See the assets to download this version and install'
releaseDraft: true
prerelease: ${{ ( ! startsWith(github.ref, 'refs/tags/v') ) }}
includeDebug: ${{ ( ! startsWith(github.ref, 'refs/tags/v') ) }}
includeRelease: ${{ ( startsWith(github.ref, 'refs/tags/v') ) }}
updaterJsonKeepUniversal: true
args: ${{ matrix.args }}
Loading

0 comments on commit cbc5ae1

Please sign in to comment.