Skip to content

Commit c9ed185

Browse files
authored
fix: try fix semantic versioning (#911)
1 parent e0a1f0e commit c9ed185

3 files changed

Lines changed: 11 additions & 29 deletions

File tree

.github/workflows/github-pages.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Build and Deploy
22
on:
33
push:
4-
branches:
5-
- main
4+
tags:
5+
- 'v*'
66
permissions:
77
contents: write
88
jobs:
@@ -13,10 +13,14 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v3
1515

16+
- name: Extract version from tag
17+
run: echo "APP_VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
18+
1619
- name: Install and Build
1720
env:
1821
USE_META_CONFIGURATOR_BASE_PATH: true # Set to true for GitHub Pages deployment
1922
VITE_FRONTEND_HOSTNAME: https://metaconfigurator.github.io/meta-configurator
23+
VITE_APP_VERSION: ${{ env.APP_VERSION }}
2024
run: |
2125
cd meta_configurator
2226
npm ci
Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Semantic Versioning
1+
name: Create Release Tag
22

33
on:
44
push:
@@ -9,40 +9,18 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
bump-version:
12+
tag:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18-
token: ${{ secrets.GITHUB_TOKEN }}
1918

20-
- name: Determine next version (dry run)
21-
id: tag
19+
- name: Bump version and create tag
2220
uses: mathieudutour/[email protected]
2321
with:
2422
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
dry_run: true
2623
default_bump: patch
27-
# Conventional Commits mapping:
28-
# fix: -> patch, feat: -> minor, BREAKING CHANGE -> major
2924
major_string_token: 'BREAKING CHANGE,!:'
3025
minor_string_token: 'feat:'
31-
patch_string_token: 'fix:,perf:,refactor:'
32-
33-
- name: Update package.json version
34-
if: steps.tag.outputs.new_tag != steps.tag.outputs.previous_tag
35-
run: |
36-
cd meta_configurator
37-
npm version ${{ steps.tag.outputs.new_version }} --no-git-tag-version
38-
39-
- name: Commit version bump and create tag
40-
if: steps.tag.outputs.new_tag != steps.tag.outputs.previous_tag
41-
run: |
42-
git config user.name "github-actions[bot]"
43-
git config user.email "github-actions[bot]@users.noreply.github.com"
44-
git add meta_configurator/package.json
45-
git commit -m "chore: bump version to ${{ steps.tag.outputs.new_version }} [skip ci]"
46-
git tag ${{ steps.tag.outputs.new_tag }}
47-
git push
48-
git push --tags
26+
patch_string_token: 'fix:,perf:,refactor:,docs:,chore:,test:'

meta_configurator/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const useMetaConfiguratorBasePath = process.env.USE_META_CONFIGURATOR_BASE_PATH
1616
export default defineConfig({
1717
base: useMetaConfiguratorBasePath ? '/meta-configurator/' : '/',
1818
define: {
19-
__APP_VERSION__: JSON.stringify(pkg.version),
19+
__APP_VERSION__: JSON.stringify(process.env.VITE_APP_VERSION || pkg.version),
2020
},
2121
plugins: [vue(), vueJsx(),
2222

0 commit comments

Comments
 (0)