Sirherobrine23 Dev #157
6
.github/ChangeVersion.js
vendored
Normal file
6
.github/ChangeVersion.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const Package_JSon = JSON.parse(fs.readFileSync(process.cwd()+'/package.json', 'utf8'));
|
||||
const run_ID = process.env.RunID || "1111111111111111111111111111111111111";
|
||||
Package_JSon.version = `${run_ID.slice(0, 2)}.${run_ID.slice(3, 6)}.${run_ID.slice(7, 11)}`;
|
||||
fs.writeFileSync(process.cwd()+'/package.json', JSON.stringify(Package_JSon, null, 2));
|
||||
console.log(Package_JSon.version);
|
15
.github/workflows/main.yml
vendored
15
.github/workflows/main.yml
vendored
@ -20,16 +20,9 @@ jobs:
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Edit Version
|
||||
uses: actions/github-script@v4
|
||||
id: set-result
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const Package_JSon = JSON.parse(fs.readFileSync(process.cwd()+'/package.json', 'utf8'));
|
||||
const run_ID = "${{ github.run_id }}";
|
||||
Package_JSon.version = `${run_ID.slice(0, 2)}.${run_ID.slice(3, 6)}.${run_ID.slice(7, 11)}`;
|
||||
fs.writeFileSync(process.cwd()+'/package.json', JSON.stringify(Package_Json, null, 2));
|
||||
result-encoding: string
|
||||
env:
|
||||
RunID: ${{ github.run_id }}
|
||||
run: node .github/ChangeVersion.js
|
||||
|
||||
- name: Install Packages
|
||||
run: npm install
|
||||
@ -95,4 +88,4 @@ jobs:
|
||||
tags: |
|
||||
bdsmaneger/base:main
|
||||
bdsmaneger/node_image:main
|
||||
platforms: ${{ env.DOCKER_ARCH }}
|
||||
platforms: ${{ env.DOCKER_ARCH }}
|
||||
|
14
.github/workflows/package_test.yml
vendored
14
.github/workflows/package_test.yml
vendored
@ -16,17 +16,9 @@ jobs:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Edit Version
|
||||
uses: actions/github-script@v4
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const Package_JSon = JSON.parse(fs.readFileSync(process.cwd()+'/package.json', 'utf8'));
|
||||
const run_ID = "${{ github.run_id }}";
|
||||
Package_JSon.version = `${run_ID.slice(0, 2)}.${run_ID.slice(3, 6)}.${run_ID.slice(7, 11)}`;
|
||||
fs.writeFileSync(process.cwd()+'/package.json', JSON.stringify(Package_Json, null, 2));
|
||||
console.log(Package_JSon.version);
|
||||
return Package_JSon.version;
|
||||
result-encoding: string
|
||||
env:
|
||||
RunID: ${{ github.run_id }}
|
||||
run: node .github/ChangeVersion.js
|
||||
|
||||
- name: Install node depedencies
|
||||
run: npm install -d --no-save
|
||||
|
Reference in New Issue
Block a user