Skip to content

Commit

Permalink
showing build info in title
Browse files Browse the repository at this point in the history
  • Loading branch information
goldbuick committed Apr 22, 2024
1 parent f0fa3af commit 29249a3
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 10 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/on-merge-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: automated versioning

on:
push:
branches:
- main

jobs:
autoversion:
name: update version on main
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v4
with:
set-safe-directory: true

- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: log version
run: cat ./package.json

- name: 'Automated Version Bump'
id: version-bump
uses: 'phips28/gh-action-bump-version@master'
with:
tag-prefix: 'v'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: log version
run: cat ./package.json

- name: signal result
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
run: echo "new tag $NEW_TAG"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ A zzt-inspired web based software framework

## brain dump kanban
https://trello.com/invite/b/fCgw9JWS/ATTI5dd28eb3e32cffabffe26939fbe1ed64B421F81F/zss

## versioning

https://github.com/phips28/gh-action-bump-version/tree/master?tab=readme-ov-file#workflow

37 changes: 28 additions & 9 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
import { execSync } from 'node:child_process'
import path from 'path'

import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import arraybuffer from 'vite-plugin-arraybuffer'

import pkg from './package.json'

// https://vitejs.dev/config/
export default defineConfig({
root: 'zss/terminal/',
envPrefix: 'ZSS_',
plugins: [react(), arraybuffer()],
resolve: {
alias: {
zss: path.resolve(__dirname, './zss'),
export default defineConfig(({ mode }) => {
// Load app-level env vars to node-level env vars.
process.env = {
...process.env,
ZSS_BRANCH_NAME: execSync('git rev-parse --abbrev-ref HEAD')
.toString()
.trimEnd(),
ZSS_BRANCH_VERSION: pkg.version,
ZSS_COMMIT_HASH: execSync('git rev-parse HEAD').toString().trimEnd(),
ZSS_COMMIT_MESSAGE: execSync('git show -s --format=%s')
.toString()
.trimEnd(),
...loadEnv(mode, process.cwd()),
}

return {
root: 'zss/terminal/',
envPrefix: 'ZSS_',
plugins: [react(), arraybuffer()],
resolve: {
alias: {
zss: path.resolve(__dirname, './zss'),
},
},
},
}
})
2 changes: 1 addition & 1 deletion zss/terminal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

<head>
<meta charset="utf-8" />
<title>ZZS - %ZSS_BRANCH_NAME%:%ZSS_BRANCH_VERSION%:%ZSS_COMMIT_HASH%</title>
<meta name="viewport" content="width=device-width user-scalable=no" />
<title></title>

<link rel="icon" type="image/x-icon" href="./favicon.ico" />
<link rel="stylesheet" href="./index.css" />
Expand Down

0 comments on commit 29249a3

Please sign in to comment.