Skip to content

Commit

Permalink
Merge pull request #14 from project-mahiwa/feat/release
Browse files Browse the repository at this point in the history
feat GitHub Actionsによるリリース
  • Loading branch information
usuyuki authored Nov 30, 2023
2 parents 7e30239 + 1a4d861 commit 68d7dd7
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 36 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand All @@ -25,19 +20,11 @@ jobs:
version: 8
run_install: false

- 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
- name: Install Node.js
uses: actions/setup-node@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# https://github.com/tauri-apps/tauri-action/blob/dev/examples/publish-to-manual-release.yml
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
- name: Rust setup
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false

- name: Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: pnpm install

- name: Build the app
uses: tauri-apps/tauri-action@v0

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
releaseName: 'App Name v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
releaseBody: 'See the assets to download and install this version.'
releaseDraft: true
prerelease: false
23 changes: 5 additions & 18 deletions .github/workflows/staticAnalysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
uses: actions/checkout@v4

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand All @@ -25,19 +20,11 @@ jobs:
version: 8
run_install: false

- 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
- name: Install Node.js
uses: actions/setup-node@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Mahiwa

[![Release](https://github.com/project-mahiwa/mahiwa/actions/workflows/release.yml/badge.svg)](https://github.com/project-mahiwa/mahiwa/actions/workflows/release.yml)
[![Lint](https://github.com/project-mahiwa/mahiwa/actions/workflows/lint.yml/badge.svg)](https://github.com/project-mahiwa/mahiwa/actions/workflows/lint.yml)
[![静的解析 (svelte-check)](https://github.com/project-mahiwa/mahiwa/actions/workflows/staticAnalysis.yml/badge.svg)](https://github.com/project-mahiwa/mahiwa/actions/workflows/staticAnalysis.yml)

## Install

https://tauri.app/v1/guides/getting-started/prerequisites
Expand Down

0 comments on commit 68d7dd7

Please sign in to comment.