mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-25 14:39:54 +03:00
ci: generate custom version name for dev + main
tags
This commit is contained in:
parent
8e98c1c63b
commit
e7e762d6d9
5 changed files with 20 additions and 1 deletions
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -15,6 +15,8 @@ jobs:
|
|||
run: npm test
|
||||
- name: Build the interface
|
||||
run: npm run build
|
||||
env:
|
||||
DEVELOPMENT_BUILD: ${{ github.sha }}
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Set up Docker Buildx
|
||||
|
|
2
.github/workflows/pull_request.yml
vendored
2
.github/workflows/pull_request.yml
vendored
|
@ -16,3 +16,5 @@ jobs:
|
|||
run: npm test
|
||||
- name: Build the interface
|
||||
run: npm run build
|
||||
env:
|
||||
DEVELOPMENT_BUILD: ${{ github.event.pull_request.head.sha }}
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -7,3 +7,4 @@ _site
|
|||
*.orig
|
||||
.serve/
|
||||
demo/v2
|
||||
.version.json
|
||||
|
|
|
@ -14,10 +14,24 @@ import copyTransform from './rollup/copy-transform.js';
|
|||
import license from './rollup/license.js';
|
||||
import checkOutput from './rollup/check-output.js';
|
||||
import importSVG from './rollup/import-svg.js';
|
||||
import fs from 'fs';
|
||||
const version = JSON.parse(fs.readFileSync('./package.json', 'utf-8')).version;
|
||||
|
||||
const useServe = process.env.ROLLUP_SERVE === 'true';
|
||||
const output = useServe ? '.serve' : 'dist';
|
||||
|
||||
const getVersion = (version) => {
|
||||
const parts = version.split('.').map((e) => parseInt(e));
|
||||
if (useServe || process.env.DEVELOPMENT_BUILD) {
|
||||
parts[1]++;
|
||||
parts[2] = 0;
|
||||
return parts.join('.') + (useServe ? '-dev' : `-${process.env.DEVELOPMENT_BUILD.slice(0, 10)}`);
|
||||
}
|
||||
return version;
|
||||
};
|
||||
|
||||
fs.writeFileSync('.version.json', JSON.stringify({ version: getVersion(version) }));
|
||||
|
||||
const plugins = [
|
||||
riot(),
|
||||
json(),
|
||||
|
|
|
@ -128,7 +128,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
</material-footer>
|
||||
</footer>
|
||||
<script>
|
||||
import { version } from '../../package.json';
|
||||
import { version } from '../../.version.json';
|
||||
import { Router, Route } from '@riotjs/route';
|
||||
import Catalog from './catalog/catalog.riot';
|
||||
import TagList from './tag-list/tag-list.riot';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue