Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04eba4de45 | ||
|
|
7bd03b5e5f | ||
|
|
fefad30ad5 | ||
|
|
9b14d8e9f0 | ||
|
|
2430f6e667 |
@@ -6,11 +6,6 @@ on:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
env:
|
|
||||||
VERSION_MAJOR: '1'
|
|
||||||
VERSION_MINOR: '1'
|
|
||||||
VERSION_PATCH: ${{ gitea.run_number }}
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -33,8 +28,9 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Set Release Version
|
- name: Set Release Version
|
||||||
id: version
|
|
||||||
run: npm run version:place
|
run: npm run version:place
|
||||||
|
env:
|
||||||
|
VERSION_PATCH: ${{ gitea.run_number }}
|
||||||
|
|
||||||
- name: Export Release Version
|
- name: Export Release Version
|
||||||
id: release_version
|
id: release_version
|
||||||
|
|||||||
Generated
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
"": {
|
"": {
|
||||||
"name": "discord-audio-stream",
|
"name": "discord-audio-stream",
|
||||||
"version": "x.x.x",
|
"version": "x.x.x",
|
||||||
"license": "LGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@discordjs/opus": "^0.10.0",
|
"@discordjs/opus": "^0.10.0",
|
||||||
"@jest/globals": "^30.4.1",
|
"@jest/globals": "^30.4.1",
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"$schema": "https://json.schemastore.org/package.json",
|
"$schema": "https://json.schemastore.org/package.json",
|
||||||
"name": "discord-audio-stream",
|
"name": "discord-audio-stream",
|
||||||
"version": "x.x.x",
|
"version": "x.x.x",
|
||||||
"license": "LGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"description": "A small Discord voice audio streaming library with managed ffmpeg playback.",
|
"description": "A small Discord voice audio streaming library with managed ffmpeg playback.",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
|
|||||||
+7
-10
@@ -3,6 +3,8 @@ const fs = require('fs');
|
|||||||
const lockFilePath = 'package-lock.json';
|
const lockFilePath = 'package-lock.json';
|
||||||
const packageFilePath = 'package.json';
|
const packageFilePath = 'package.json';
|
||||||
const placeholderVersion = 'x.x.x';
|
const placeholderVersion = 'x.x.x';
|
||||||
|
const versionMajor = 1;
|
||||||
|
const versionMinor = 2;
|
||||||
const command = process.argv[2];
|
const command = process.argv[2];
|
||||||
|
|
||||||
function readJson(path) {
|
function readJson(path) {
|
||||||
@@ -24,7 +26,7 @@ function getLockFile() {
|
|||||||
function writeVersions(version) {
|
function writeVersions(version) {
|
||||||
const pkg = readJson(packageFilePath);
|
const pkg = readJson(packageFilePath);
|
||||||
pkg.version = version;
|
pkg.version = version;
|
||||||
writeJson(packageFilePath, pkg, 2);
|
writeJson(packageFilePath, pkg, 4);
|
||||||
|
|
||||||
const lock = getLockFile();
|
const lock = getLockFile();
|
||||||
|
|
||||||
@@ -74,19 +76,14 @@ function fixPlaceholder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getCiVersion() {
|
function getCiVersion() {
|
||||||
const major = process.env.VERSION_MAJOR;
|
|
||||||
const minor = process.env.VERSION_MINOR;
|
|
||||||
const patch = process.env.VERSION_PATCH;
|
const patch = process.env.VERSION_PATCH;
|
||||||
const segments = { major, minor, patch };
|
|
||||||
|
|
||||||
for (const [name, value] of Object.entries(segments)) {
|
if (!/^\d+$/.test(patch ?? '')) {
|
||||||
if (!/^\d+$/.test(value ?? '')) {
|
console.error(`Missing or invalid patch version segment: "${patch ?? ''}"`);
|
||||||
console.error(`Missing or invalid ${name} version segment: "${value ?? ''}"`);
|
process.exit(1);
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${major}.${minor}.${patch}`;
|
return `${versionMajor}.${versionMinor}.${patch}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command === 'check-placeholder') {
|
if (command === 'check-placeholder') {
|
||||||
|
|||||||
Reference in New Issue
Block a user