feat(ci): support to run release-tamagotchi.yml workflow for deb and rpm files
This commit is contained in:
@@ -4,8 +4,9 @@ permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
PRODUCT_NAME: 'AIRI'
|
||||
BUNDLE_NAME: ''
|
||||
PRODUCT_NAME: 'AIRI'
|
||||
VERSION: ''
|
||||
|
||||
on:
|
||||
release:
|
||||
@@ -40,32 +41,32 @@ jobs:
|
||||
- os: macos-13
|
||||
artifact: darwin-x64
|
||||
target: x86_64-apple-darwin
|
||||
arch: x64
|
||||
builder-args: --macos --x64
|
||||
ext: dmg
|
||||
|
||||
- os: macos-latest
|
||||
artifact: darwin-arm64
|
||||
target: aarch64-apple-darwin
|
||||
builder-args: --macos --arm64
|
||||
ext: dmg
|
||||
arch: arm64
|
||||
|
||||
- os: ubuntu-latest
|
||||
artifact: linux-x64
|
||||
target: x86_64-unknown-linux-gnu
|
||||
builder-args: --linux --x64
|
||||
ext: AppImage
|
||||
arch: x64
|
||||
|
||||
- os: ubuntu-24.04-arm
|
||||
artifact: linux-arm64
|
||||
target: aarch64-unknown-linux-gnu
|
||||
builder-args: --linux --arm64
|
||||
ext: AppImage
|
||||
arch: arm64
|
||||
|
||||
- os: windows-latest
|
||||
artifact: windows-x64-setup
|
||||
target: x86_64-pc-windows-msvc
|
||||
builder-args: --windows --x64
|
||||
ext: exe
|
||||
arch: x64
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
@@ -108,58 +109,95 @@ jobs:
|
||||
# ---------
|
||||
# Nightly (schedule) builds only
|
||||
# ---------
|
||||
- name: Get Name of Artifacts (Nightly + Windows Only)
|
||||
|
||||
- name: Get Artifacts Envs (Nightly + Windows Only)
|
||||
if: ${{ github.event_name == 'schedule' && matrix.os == 'windows-latest' }}
|
||||
run: |
|
||||
pnpm -F @proj-airi/stage-tamagotchi name-of-artifacts ${{ matrix.target }} --out bundle_name
|
||||
echo "BUNDLE_NAME=$(node -p "require('node:fs').readFileSync(require('node:path').join('apps', 'stage-tamagotchi', 'bundle_name')).toString('utf-8')")" >> $env:GITHUB_ENV
|
||||
echo "BUNDLE_NAME=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-bundle-name)" >> $env:GITHUB_ENV
|
||||
echo "VERSION=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-version)" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Get Name of Artifacts (Nightly)
|
||||
- name: Get Artifacts Envs (Nightly + Non-Windows)
|
||||
if: ${{ github.event_name == 'schedule' && matrix.os != 'windows-latest' }}
|
||||
run: |
|
||||
pnpm -F @proj-airi/stage-tamagotchi name-of-artifacts ${{ matrix.target }} --out bundle_name
|
||||
echo "BUNDLE_NAME=$(node -p "require('node:fs').readFileSync(require('node:path').join('apps', 'stage-tamagotchi', 'bundle_name')).toString('utf-8')")" >> $GITHUB_ENV
|
||||
echo "VERSION=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-version)" >> $GITHUB_ENV
|
||||
|
||||
- name: Get Artifacts Envs (Nightly + macOS Only)
|
||||
if: ${{ github.event_name == 'schedule' && (matrix.os == 'macos-latest' || matrix.os == 'macos-13') }}
|
||||
run: |
|
||||
echo "BUNDLE_NAME=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-bundle-name)" >> $GITHUB_ENV
|
||||
|
||||
- name: Rename Artifacts (Nightly)
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
run:
|
||||
pnpm run -F @proj-airi/stage-tamagotchi rename-artifacts ${{ matrix.target }}
|
||||
|
||||
- name: Upload Artifacts (Nightly)
|
||||
if: ${{ github.event_name == 'schedule' }}
|
||||
- name: Upload Artifacts (Nightly + Non-Linux)
|
||||
if: ${{ github.event_name == 'schedule' && (matrix.os != 'ubuntu-latest' && matrix.os != 'ubuntu-24.04-arm') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.BUNDLE_NAME }}
|
||||
path: apps/stage-tamagotchi/bundle/${{ env.BUNDLE_NAME }}
|
||||
|
||||
# ---------
|
||||
# Workflow Dispatch only
|
||||
# ---------
|
||||
- name: Upload Artifacts (Nightly + Linux deb)
|
||||
if: ${{ github.event_name == 'schedule' && (matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.deb
|
||||
path: apps/stage-tamagotchi/bundle/${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.deb
|
||||
|
||||
- name: Get Name of Artifacts (Manual + Windows Only)
|
||||
- name: Upload Artifacts (Nightly + Linux rpm)
|
||||
if: ${{ github.event_name == 'schedule' && (matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.rpm
|
||||
path: apps/stage-tamagotchi/bundle/${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.rpm
|
||||
|
||||
# ---------
|
||||
# Workflow Dispatch only
|
||||
# ---------
|
||||
|
||||
- name: Get Artifacts Envs (Manual + Windows Only)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && matrix.os == 'windows-latest' }}
|
||||
run: |
|
||||
pnpm -F @proj-airi/stage-tamagotchi name-of-artifacts ${{ matrix.target }} --out bundle_name --release ${{ !inputs.build_only && !inputs.artifacts_only }} --tag ${{ inputs.tag }} --auto-tag ${{ !inputs.build_only }}
|
||||
echo "BUNDLE_NAME=$(node -p "require('node:fs').readFileSync(require('node:path').join('apps', 'stage-tamagotchi', 'bundle_name')).toString('utf-8')")" >> $env:GITHUB_ENV
|
||||
echo "BUNDLE_NAME=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-bundle-name --release ${{ !inputs.build_only && !inputs.artifacts_only }} --tag ${{ inputs.tag }} --auto-tag ${{ !inputs.build_only }})" >> $env:GITHUB_ENV
|
||||
echo "VERSION=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-version --release ${{ !inputs.build_only && !inputs.artifacts_only }} --tag ${{ inputs.tag }} --auto-tag ${{ !inputs.build_only }})" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Get Name of Artifacts (Manual)
|
||||
- name: Get Artifacts Envs (Manual + Non-Windows)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && matrix.os != 'windows-latest' }}
|
||||
run: |
|
||||
pnpm -F @proj-airi/stage-tamagotchi name-of-artifacts ${{ matrix.target }} --out bundle_name --release ${{ !inputs.build_only && !inputs.artifacts_only }} --tag ${{ inputs.tag }} --auto-tag ${{ !inputs.build_only }}
|
||||
echo "BUNDLE_NAME=$(node -p "require('node:fs').readFileSync(require('node:path').join('apps', 'stage-tamagotchi', 'bundle_name')).toString('utf-8')")" >> $GITHUB_ENV
|
||||
echo "VERSION=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-version --release ${{ !inputs.build_only && !inputs.artifacts_only }} --tag ${{ inputs.tag }} --auto-tag ${{ !inputs.build_only }})" >> $GITHUB_ENV
|
||||
|
||||
- name: Get Artifacts Envs (Manual + macOS Only)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && (matrix.os == 'macos-latest' || matrix.os == 'macos-13') }}
|
||||
run: |
|
||||
echo "BUNDLE_NAME=$(pnpm -F @proj-airi/stage-tamagotchi artifacts-metadata ${{ matrix.target }} --get-bundle-name --release ${{ !inputs.build_only && !inputs.artifacts_only }} --tag ${{ inputs.tag }} --auto-tag ${{ !inputs.build_only }})" >> $GITHUB_ENV
|
||||
|
||||
- name: Rename Artifacts (Manual)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||
run: |
|
||||
pnpm run -F @proj-airi/stage-tamagotchi rename-artifacts ${{ matrix.target }} --release ${{ !inputs.build_only && !inputs.artifacts_only }} --tag ${{ inputs.tag }} --auto-tag ${{ !inputs.build_only }}
|
||||
|
||||
- name: Upload Artifacts (Manual + Non-Release)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.build_only && inputs.artifacts_only }}
|
||||
- name: Upload Artifacts (Manual + Non-Release + Non-Linux)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.build_only && inputs.artifacts_only && (matrix.os != 'ubuntu-latest' && matrix.os != 'ubuntu-24.04-arm') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.BUNDLE_NAME }}
|
||||
path: apps/stage-tamagotchi/bundle/${{ env.BUNDLE_NAME }}
|
||||
|
||||
- name: Upload Artifacts (Manual + Non-Release + Linux deb)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.build_only && inputs.artifacts_only && (matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.deb
|
||||
path: apps/stage-tamagotchi/bundle/${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.deb
|
||||
|
||||
- name: Upload Artifacts (Manual + Non-Release + Linux rpm)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.build_only && inputs.artifacts_only && (matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm') }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.rpm
|
||||
path: apps/stage-tamagotchi/bundle/${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-linux-${{ matrix.arch }}.rpm
|
||||
|
||||
- name: Upload To GitHub Releases (Manual + Overwrite Release)
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && !inputs.build_only && !inputs.artifacts_only }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"build:mac": "pnpm run build && electron-builder --mac",
|
||||
"build:linux": "pnpm run build && electron-builder --linux",
|
||||
"rename-artifacts": "mkdir -p bundle && tsx scripts/rename-artifacts.ts",
|
||||
"name-of-artifacts": "tsx scripts/name-of-artifacts.ts"
|
||||
"artifacts-metadata": "tsx scripts/artifacts-metadata.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@date-fns/utc": "^2.1.1",
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import process from 'node:process'
|
||||
|
||||
import { cac } from 'cac'
|
||||
|
||||
import { getElectronBuilderConfig, getFilenames, getVersion } from './utils'
|
||||
|
||||
async function main() {
|
||||
const cli = cac('name-of-artifact')
|
||||
.option(
|
||||
'--release',
|
||||
'Rename with version from package.json',
|
||||
{ default: false },
|
||||
)
|
||||
.option(
|
||||
'--auto-tag',
|
||||
'Automatically tag the release with the latest git ref',
|
||||
{ default: false },
|
||||
)
|
||||
.option(
|
||||
'--tag <tag>',
|
||||
'Tag to use for the release',
|
||||
{ default: '', type: [String] },
|
||||
)
|
||||
.option(
|
||||
'--get-bundle-name',
|
||||
'Get the bundle name',
|
||||
{ default: false },
|
||||
)
|
||||
.option(
|
||||
'--get-product-name',
|
||||
'Get the product name',
|
||||
{ default: false },
|
||||
)
|
||||
.option(
|
||||
'--get-version',
|
||||
'Get the version',
|
||||
{ default: false },
|
||||
)
|
||||
|
||||
const args = cli.parse()
|
||||
|
||||
const argOptions = args.options as {
|
||||
release: boolean
|
||||
autoTag: boolean
|
||||
tag: string[]
|
||||
getBundleName: boolean
|
||||
getProductName: boolean
|
||||
getVersion: boolean
|
||||
}
|
||||
|
||||
const target = args.args[0]
|
||||
if (argOptions.getBundleName) {
|
||||
const filenames = await getFilenames(target, argOptions)
|
||||
console.info(filenames[0].releaseArtifactFilename)
|
||||
}
|
||||
if (argOptions.getProductName) {
|
||||
const electronBuilderConfig = await getElectronBuilderConfig()
|
||||
console.info(electronBuilderConfig.productName)
|
||||
}
|
||||
if (argOptions.getVersion) {
|
||||
const version = await getVersion({ release: argOptions.release, autoTag: argOptions.autoTag, tag: argOptions.tag })
|
||||
console.info(version)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((error) => {
|
||||
console.error('Error during generating name:', error)
|
||||
process.exit(1)
|
||||
})
|
||||
@@ -1,60 +0,0 @@
|
||||
import process from 'node:process'
|
||||
|
||||
import { existsSync, mkdirSync, writeFileSync } from 'node:fs'
|
||||
import { dirname } from 'node:path'
|
||||
|
||||
import { cac } from 'cac'
|
||||
|
||||
import { getFilename } from './utils'
|
||||
|
||||
async function main() {
|
||||
const cli = cac('name-of-artifact')
|
||||
.option(
|
||||
'--release',
|
||||
'Rename with version from package.json',
|
||||
{ default: false },
|
||||
)
|
||||
.option(
|
||||
'--auto-tag',
|
||||
'Automatically tag the release with the latest git ref',
|
||||
{ default: false },
|
||||
)
|
||||
.option(
|
||||
'--tag <tag>',
|
||||
'Tag to use for the release',
|
||||
{ default: '', type: [String] },
|
||||
)
|
||||
.option(
|
||||
'--out <path>',
|
||||
'Path to output the filename',
|
||||
{ default: 'bundle_name', type: [String] },
|
||||
)
|
||||
|
||||
const args = cli.parse()
|
||||
|
||||
const argOptions = args.options as {
|
||||
release: boolean
|
||||
autoTag: boolean
|
||||
tag: string[]
|
||||
out: string[]
|
||||
}
|
||||
|
||||
const target = args.args[0]
|
||||
const filename = await getFilename(target, argOptions)
|
||||
if (argOptions.out[0]) {
|
||||
if (!existsSync(dirname(argOptions.out[0]))) {
|
||||
mkdirSync(dirname(argOptions.out[0]), { recursive: true })
|
||||
}
|
||||
|
||||
writeFileSync(argOptions.out[0], filename, { encoding: 'utf-8' })
|
||||
}
|
||||
else {
|
||||
console.info(filename)
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((error) => {
|
||||
console.error('Error during generating name:', error)
|
||||
process.exit(1)
|
||||
})
|
||||
@@ -7,7 +7,7 @@ import { cac } from 'cac'
|
||||
|
||||
import packageJSON from '../package.json' assert { type: 'json' }
|
||||
|
||||
import { getElectronBuilderConfig, getFilename, getVersion } from './utils'
|
||||
import { getElectronBuilderConfig, getFilenames, getVersion } from './utils'
|
||||
|
||||
async function main() {
|
||||
const cli = cac('rename-artifact')
|
||||
@@ -66,39 +66,15 @@ async function main() {
|
||||
|
||||
mkdirSync(bundlePrefix, { recursive: true })
|
||||
|
||||
let renameFrom = ''
|
||||
let renameTo = ''
|
||||
const filename = await getFilename(target, argOptions)
|
||||
console.info(filename, 'is the target filename')
|
||||
const filenames = await getFilenames(target, argOptions)
|
||||
console.info(filenames, 'is the target filename')
|
||||
|
||||
switch (target) {
|
||||
case 'x86_64-pc-windows-msvc':
|
||||
renameFrom = join(srcPrefix, `${beforeProductName}-${beforeVersion}-windows-x64-setup.exe`)
|
||||
renameTo = join(bundlePrefix, filename)
|
||||
break
|
||||
case 'x86_64-unknown-linux-gnu':
|
||||
renameFrom = join(srcPrefix, `${beforeProductName}-${beforeVersion}-linux-x86_64.AppImage`)
|
||||
renameTo = join(bundlePrefix, filename)
|
||||
break
|
||||
case 'aarch64-unknown-linux-gnu':
|
||||
renameFrom = join(srcPrefix, `${beforeProductName}-${beforeVersion}-linux-arm64.AppImage`)
|
||||
renameTo = join(bundlePrefix, filename)
|
||||
break
|
||||
case 'aarch64-apple-darwin':
|
||||
renameFrom = join(srcPrefix, `${beforeProductName}-${beforeVersion}-darwin-arm64.dmg`)
|
||||
renameTo = join(bundlePrefix, filename)
|
||||
break
|
||||
case 'x86_64-apple-darwin':
|
||||
renameFrom = join(srcPrefix, `${beforeProductName}-${beforeVersion}-darwin-x64.dmg`)
|
||||
renameTo = join(bundlePrefix, filename)
|
||||
break
|
||||
default:
|
||||
console.error('Target is not supported')
|
||||
process.exit(1)
|
||||
for (const filename of filenames) {
|
||||
const renameFrom = join(srcPrefix, filename.outputFilename)
|
||||
const renameTo = join(bundlePrefix, filename.releaseArtifactFilename)
|
||||
console.info('renaming, from:', renameFrom, 'to:', renameTo)
|
||||
renameSync(renameFrom, renameTo)
|
||||
}
|
||||
|
||||
console.info('renaming, from:', renameFrom, 'to:', renameTo)
|
||||
renameSync(renameFrom, renameTo)
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -57,7 +57,34 @@ export async function getElectronBuilderConfig() {
|
||||
return yaml.parse(await readFile(resolve(import.meta.dirname, '..', 'electron-builder.yml'), 'utf-8')) as Configuration
|
||||
}
|
||||
|
||||
export async function getFilename(target: string, options: { release: boolean, autoTag: boolean, tag: string[] }) {
|
||||
export function applyTemplateOfArtifactName(
|
||||
template: string,
|
||||
productName: string,
|
||||
version: string,
|
||||
arch: string,
|
||||
ext: string,
|
||||
): string {
|
||||
return template
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${productName}', productName)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${version}', version)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${arch}', arch)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${ext}', ext)
|
||||
}
|
||||
|
||||
interface FilenameOutputEntry {
|
||||
target: string
|
||||
extension: string
|
||||
outputFilename: string
|
||||
releaseArtifactFilename: string
|
||||
productName: string
|
||||
version: string
|
||||
}
|
||||
|
||||
export async function getFilenames(target: string, options: { release: boolean, autoTag: boolean, tag: string[] }): Promise<FilenameOutputEntry[]> {
|
||||
const electronBuilder = await getElectronBuilderConfig()
|
||||
const version = await getVersion(options)
|
||||
|
||||
@@ -65,62 +92,122 @@ export async function getFilename(target: string, options: { release: boolean, a
|
||||
throw new Error('<Target> is required')
|
||||
}
|
||||
|
||||
const beforeVersion = version
|
||||
const productName = electronBuilder.productName!
|
||||
|
||||
switch (target) {
|
||||
case 'x86_64-pc-windows-msvc':
|
||||
|
||||
return electronBuilder.nsis?.artifactName
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
?.replace('${productName}', electronBuilder.productName!)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${version}', version)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${arch}', 'x64')
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${ext}', 'exe') ?? `${electronBuilder.productName}-${version}-windows-x64-setup.exe`
|
||||
break
|
||||
return [
|
||||
{
|
||||
target: 'x86_64-pc-windows-msvc',
|
||||
extension: 'exe',
|
||||
outputFilename: applyTemplateOfArtifactName(electronBuilder.nsis?.artifactName!, productName, beforeVersion, 'x64', 'exe'),
|
||||
releaseArtifactFilename: applyTemplateOfArtifactName(electronBuilder.nsis?.artifactName!, productName, version, 'x64', 'exe'),
|
||||
productName,
|
||||
version,
|
||||
},
|
||||
]
|
||||
case 'x86_64-unknown-linux-gnu':
|
||||
return electronBuilder.linux?.artifactName
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
?.replace('${productName}', electronBuilder.productName!)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${version}', version)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${arch}', 'x64')
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${ext}', 'AppImage') ?? `${electronBuilder.productName}-${version}-linux-x64.AppImage`
|
||||
break
|
||||
{
|
||||
const artifacts: FilenameOutputEntry[] = []
|
||||
if (electronBuilder.linux?.artifactName) {
|
||||
if (
|
||||
(Array.isArray(electronBuilder.linux.target) && electronBuilder.linux.target.includes('deb'))
|
||||
|| electronBuilder.linux.target === 'deb'
|
||||
) {
|
||||
artifacts.push(
|
||||
{
|
||||
target: 'x86_64-unknown-linux-gnu',
|
||||
extension: 'deb',
|
||||
outputFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, beforeVersion, 'x64', 'deb'),
|
||||
releaseArtifactFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, version, 'x64', 'deb'),
|
||||
productName,
|
||||
version,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if (
|
||||
(Array.isArray(electronBuilder.linux.target) && electronBuilder.linux.target.includes('rpm'))
|
||||
|| electronBuilder.linux.target === 'rpm'
|
||||
) {
|
||||
artifacts.push(
|
||||
{
|
||||
target: 'x86_64-unknown-linux-gnu',
|
||||
extension: 'rpm',
|
||||
outputFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, beforeVersion, 'x64', 'rpm'),
|
||||
releaseArtifactFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, version, 'x64', 'rpm'),
|
||||
productName,
|
||||
version,
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return artifacts
|
||||
}
|
||||
case 'aarch64-unknown-linux-gnu':
|
||||
return electronBuilder.linux?.artifactName
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
?.replace('${productName}', electronBuilder.productName!)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${version}', version)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${arch}', 'arm64')
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${ext}', 'AppImage') ?? `${electronBuilder.productName}-${version}-linux-arm64.AppImage`
|
||||
break
|
||||
{
|
||||
const artifacts: FilenameOutputEntry[] = []
|
||||
if (electronBuilder.linux?.artifactName) {
|
||||
if (
|
||||
(Array.isArray(electronBuilder.linux.target) && electronBuilder.linux.target.includes('deb'))
|
||||
|| electronBuilder.linux.target === 'deb'
|
||||
) {
|
||||
artifacts.push(
|
||||
{
|
||||
target: 'aarch64-unknown-linux-gnu',
|
||||
extension: 'deb',
|
||||
outputFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, beforeVersion, 'arm64', 'deb'),
|
||||
releaseArtifactFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, version, 'arm64', 'deb'),
|
||||
productName,
|
||||
version,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if (
|
||||
(Array.isArray(electronBuilder.linux.target) && electronBuilder.linux.target.includes('rpm'))
|
||||
|| electronBuilder.linux.target === 'rpm'
|
||||
) {
|
||||
artifacts.push(
|
||||
{
|
||||
target: 'aarch64-unknown-linux-gnu',
|
||||
extension: 'rpm',
|
||||
outputFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, beforeVersion, 'arm64', 'rpm'),
|
||||
releaseArtifactFilename: applyTemplateOfArtifactName(electronBuilder.linux.artifactName!, productName, version, 'arm64', 'rpm'),
|
||||
productName,
|
||||
version,
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return artifacts
|
||||
}
|
||||
case 'aarch64-apple-darwin':
|
||||
return electronBuilder.dmg?.artifactName
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
?.replace('${productName}', electronBuilder.productName!)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${version}', version)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${arch}', 'arm64')
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${ext}', 'dmg') ?? `${electronBuilder.productName}-${version}-darwin-arm64.dmg`
|
||||
break
|
||||
return [
|
||||
{
|
||||
target: 'aarch64-apple-darwin',
|
||||
extension: 'dmg',
|
||||
outputFilename: applyTemplateOfArtifactName(electronBuilder.dmg?.artifactName!, productName, beforeVersion, 'arm64', 'dmg'),
|
||||
releaseArtifactFilename: applyTemplateOfArtifactName(electronBuilder.dmg?.artifactName!, productName, version, 'arm64', 'dmg'),
|
||||
productName,
|
||||
version,
|
||||
},
|
||||
]
|
||||
case 'x86_64-apple-darwin':
|
||||
return electronBuilder.dmg?.artifactName
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
?.replace('${productName}', electronBuilder.productName!)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${version}', version)
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${arch}', 'x64')
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
.replace('${ext}', 'dmg') ?? `${electronBuilder.productName}-${version}-darwin-x64.dmg`
|
||||
return [
|
||||
{
|
||||
target: 'x86_64-apple-darwin',
|
||||
extension: 'dmg',
|
||||
outputFilename: applyTemplateOfArtifactName(electronBuilder.dmg?.artifactName!, productName, beforeVersion, 'x64', 'dmg'),
|
||||
releaseArtifactFilename: applyTemplateOfArtifactName(electronBuilder.dmg?.artifactName!, productName, version, 'x64', 'dmg'),
|
||||
productName,
|
||||
version,
|
||||
},
|
||||
]
|
||||
default:
|
||||
console.error('Target is not supported')
|
||||
process.exit(1)
|
||||
|
||||
@@ -178,6 +178,7 @@ words:
|
||||
- nomic
|
||||
- novita
|
||||
- nprogress
|
||||
- nsis
|
||||
- nuxi
|
||||
- nuxt
|
||||
- nuxtjs
|
||||
|
||||
Reference in New Issue
Block a user