Skip to content

Commit

Permalink
build: provide version at runtime
Browse files Browse the repository at this point in the history
and in title of the deployed demo
  • Loading branch information
davidenke committed Nov 7, 2024
1 parent ee397db commit af4ff6e
Show file tree
Hide file tree
Showing 6 changed files with 331 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

- name: Install dependencies
run: |
pnpm install --global release-it @release-it/conventional-changelog
pnpm install --global tsx release-it @release-it/conventional-changelog
cargo install cargo-bump
- name: Prepare release
Expand All @@ -92,6 +92,7 @@ jobs:
--hooks.before:release='cargo bump --manifest-path src-tauri/Cargo.toml ${version}' \
--hooks.before:release='cargo update --manifest-path src-tauri/Cargo.toml --precise ${version} live-protocol' \
--hooks.before:release='git add src-tauri/tauri.conf.json src-tauri/Cargo.toml src-tauri/Cargo.lock'
--hooks.before:release='tsx scripts/set-version.ts ${version}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -123,6 +124,7 @@ jobs:
cache: pnpm
- run: pnpm install
- run: ./node_modules/.bin/vite build --mode detached
- run: pnpm dlx tsx scripts/set-version.ts ${{ needs.prepare.outputs.version }}
- uses: actions/upload-pages-artifact@v3
with:
path: demo
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Live Protocol Demo</title>
<title>Live Protocol ##VERSION## Demo</title>
<link rel="stylesheet" href="src/index.css" />
<script type="module" src="/src/index.ts" defer></script>
</head>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"eslint-plugin-simple-import-sort": "12.1.1",
"eslint-plugin-unused-imports": "4.1.4",
"eslint-plugin-wc": "2.2.0",
"fast-glob": "3.3.2",
"jiti": "2.3.3",
"postcss": "8.4.47",
"postject": "1.0.0-alpha.6",
Expand Down
Loading

0 comments on commit af4ff6e

Please sign in to comment.