feat(ci): support to run release-tamagotchi.yml workflow for deb and rpm files

This commit is contained in:
Neko Ayaka
2025-10-20 13:00:30 +08:00
parent 32934b9bbe
commit ad786013b0
7 changed files with 280 additions and 168 deletions
+63 -25
View File
@@ -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