Skip to content

Commit 57c02f3

Browse files
ci: build/release when new tag is created
1 parent 8787db4 commit 57c02f3

File tree

7 files changed

+40
-16
lines changed

7 files changed

+40
-16
lines changed

.github/workflows/build.yaml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: "publish"
22

33
on:
4-
workflow_dispatch:
54
push:
6-
branches:
7-
- release
5+
tags:
6+
- 'app-v[0-9]+.[0-9]+.[0-9]+'
7+
8+
concurrency: build
89

910
jobs:
1011
publish-tauri:
@@ -24,9 +25,19 @@ jobs:
2425
args: ""
2526

2627
runs-on: ${{ matrix.platform }}
28+
environment: Release
2729
steps:
30+
- run: |
31+
git config --global core.autocrlf input
32+
git config --global core.eol lf
2833
- uses: actions/checkout@v4
2934

35+
- name: Setup Biome
36+
uses: biomejs/setup-biome@v2
37+
38+
- name: Run Biome
39+
run: biome ci .
40+
3041
- name: install dependencies (ubuntu only)
3142
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
3243
run: |
@@ -50,14 +61,22 @@ jobs:
5061

5162
- name: install frontend dependencies
5263
run: bun install
64+
65+
- name: Setup build variables
66+
shell: bash
67+
run: |
68+
VERSION=$(echo "${GITHUB_REF_NAME}" | sed 's/app-v//')
69+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
70+
71+
sed -i='' "s/0.0.0-dev/${VERSION}/" src-tauri/tauri.conf.json
5372
5473
- uses: tauri-apps/tauri-action@v0
5574
env:
5675
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
77+
GIT_HASH: ${{ github.sha }}
5778
with:
58-
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
79+
tagName: ${{ github.ref_name }}
5980
releaseName: "App v__VERSION__"
6081
releaseBody: "See the assets to download this version and install."
61-
releaseDraft: true
62-
prerelease: false
6382
args: ${{ matrix.args }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "shadps4-launcher",
33
"private": true,
4-
"version": "0.1.0",
4+
"version": "1.0.0",
55
"type": "module",
66
"scripts": {
77
"dev": "tauri dev --config ./src-tauri/tauri.dev.conf.json",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shadps4-launcher"
3-
version = "0.1.0"
3+
version = "1.0.0"
44
description = "ShadPS4 Launcher"
55
authors = ["Vinicius Rangel <[email protected]>"]
66
edition = "2021"

src-tauri/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ pub fn run() {
2929
.plugin(tauri_plugin_updater::Builder::new().build())
3030
.plugin(tauri_plugin_upload::init())
3131
.setup(|app| {
32-
info!("Starting app");
32+
let commit = option_env!("GIT_HASH");
33+
if let Some(commit) = commit {
34+
info!("Starting app. build git ref={}", commit);
35+
} else {
36+
info!("Starting app. Unknown build git ref");
37+
}
3338
GameBridge::register(&app.handle());
3439
Ok(())
3540
})

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "shadps4-launcher",
4-
"version": "0.2.4",
4+
"version": "0.0.0-dev",
55
"identifier": "net.shadps4.app",
66
"build": {
77
"beforeDevCommand": "bun vite:dev",

src/store/version-manager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { readConfig } from "@/handlers/version-manager";
2-
import { stringifyError } from "@/utils/error";
3-
import { atomKeepLast } from "@/utils/jotai/atom-keep-last";
4-
import { atomWithTauriStore } from "@/utils/jotai/tauri-store";
51
import { join } from "@tauri-apps/api/path";
62
import { exists, mkdir, readDir, watch } from "@tauri-apps/plugin-fs";
73
import { platform } from "@tauri-apps/plugin-os";
84
import { atom } from "jotai";
9-
import { atomWithQuery } from "jotai-tanstack-query";
105
import { unwrap } from "jotai/utils";
6+
import { atomWithQuery } from "jotai-tanstack-query";
117
import { Octokit } from "octokit";
128
import { toast } from "sonner";
9+
import { readConfig } from "@/handlers/version-manager";
10+
import { stringifyError } from "@/utils/error";
11+
import { atomKeepLast } from "@/utils/jotai/atom-keep-last";
12+
import { atomWithTauriStore } from "@/utils/jotai/tauri-store";
1313
import { defaultStore, type JotaiStore } from ".";
1414
import { oficialRepo } from "./common";
1515
import { atomEmuInstallsPath } from "./paths";

0 commit comments

Comments
 (0)