01bcb804b3
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.4.0 to 7.0.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e...820762786026740c76f36085b0efc47a31fe5020) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
369 lines
16 KiB
YAML
369 lines
16 KiB
YAML
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
|
|
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, development, '**-RC' ]
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- '.github/**/*.md'
|
|
- '.github/workflows/autoMerge.yml'
|
|
- '.github/workflows/calibreapp-image-actions.yml'
|
|
- '.github/workflows/codeql.yml'
|
|
- '.github/workflows/conflicts.yml'
|
|
- '.github/workflows/label-issue.yml'
|
|
- '.github/workflows/label-pr.yml'
|
|
- '.github/workflows/no-response.yml'
|
|
- '.github/workflows/release.yml'
|
|
- '.github/workflows/remove-outdated-labels.yml'
|
|
- '.github/workflows/stale.yml'
|
|
- '.github/workflows/updateSite.yml'
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
|
|
# As this action runs on every push to the default branch and uses quite a lot of resources (both minutes and caches),
|
|
# only run it in the FreeTubeApp/FreeTube repository to avoid unnecessary GitHub Actions usage/billing in forks.
|
|
# Still allow manually triggering the workflow.
|
|
# If a fork does need this workflow to run on every push to the default branch, they can change this condition in their fork to include their repository.
|
|
if: github.repository == 'FreeTubeApp/FreeTube' || github.event_name == 'workflow_dispatch'
|
|
|
|
permissions:
|
|
actions: write
|
|
contents: read
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [24.x]
|
|
runtime:
|
|
- linux-x64
|
|
- linux-armv7l
|
|
- linux-arm64
|
|
- win-x64
|
|
- win-arm64
|
|
- osx-x64
|
|
- osx-arm64
|
|
include:
|
|
- runtime: linux-x64
|
|
os: ubuntu-latest
|
|
|
|
- runtime: linux-armv7l
|
|
os: ubuntu-latest
|
|
|
|
- runtime: linux-arm64
|
|
os: ubuntu-latest
|
|
|
|
- runtime: osx-x64
|
|
os: macOS-latest
|
|
|
|
- runtime: osx-arm64
|
|
os: macOS-latest
|
|
|
|
- runtime: win-x64
|
|
os: windows-latest
|
|
|
|
- runtime: win-arm64
|
|
os: windows-latest
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 #v7.0.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
package-manager-cache: false
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 #v6.0.9
|
|
with:
|
|
version: 10
|
|
cache: false
|
|
|
|
- name: Get pnpm cache directory
|
|
id: cache_dir
|
|
shell: bash
|
|
run: |
|
|
{
|
|
echo 'cache_dir<<EOF'
|
|
pnpm store path
|
|
echo EOF
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Restore pnpm cache
|
|
id: restore_cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
|
|
with:
|
|
key: ${{ format('node-cache-{0}-{1}-pnpm-{2}', runner.os, runner.arch, hashFiles('pnpm-lock.yaml')) }}
|
|
path: ${{ steps.cache_dir.outputs.cache_dir }}
|
|
|
|
- run: pnpm run ci
|
|
shell: bash
|
|
- run: pnpm run lint
|
|
shell: bash
|
|
- name: Set version number
|
|
id: versionNumber
|
|
shell: bash
|
|
run: |
|
|
original_version="$(jq -r '.version' package.json)"
|
|
version="$original_version"
|
|
|
|
lower_case_ref="$(echo -E "$GITHUB_REF" | tr '[:upper:]' '[:lower:]')"
|
|
|
|
if [[ "$lower_case_ref" == *development* ]]; then
|
|
version="${original_version}-nightly-${GITHUB_RUN_NUMBER}"
|
|
elif [[ "$lower_case_ref" == *rc* ]]; then
|
|
version="${original_version}-RC-${GITHUB_RUN_NUMBER}"
|
|
fi
|
|
|
|
package_json="$(jq --arg version "$version" '.version = $version' package.json)"
|
|
|
|
echo -E "$package_json" > package.json
|
|
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Install libarchive-tools
|
|
if: startsWith(matrix.os, 'ubuntu')
|
|
shell: bash
|
|
run: |
|
|
sudo apt update
|
|
sudo apt -y install libarchive-tools
|
|
|
|
- name: Build x64 with Node.js ${{ matrix.node-version}}
|
|
if: contains(matrix.runtime, 'x64')
|
|
shell: bash
|
|
run: pnpm run build
|
|
|
|
- name: Build ARMv7l with Node.js ${{ matrix.node-version}}
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
|
|
shell: bash
|
|
run: pnpm run build:arm32
|
|
|
|
- name: Build ARM64 with Node.js ${{ matrix.node-version}}
|
|
if: contains(matrix.runtime, 'arm64')
|
|
shell: bash
|
|
run: pnpm run build:arm64
|
|
|
|
- name: Upload Linux .zip x64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-linux-x64-portable.zip
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}.zip
|
|
|
|
- name: Upload Linux .7z x64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-linux-x64-portable.7z
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}.7z
|
|
|
|
- name: Upload Linux .zip ARMv7l Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-linux-armv7l-portable.zip
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-armv7l.zip
|
|
|
|
- name: Upload Linux .7z ARMv7l Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-linux-armv7l-portable.7z
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-armv7l.7z
|
|
|
|
- name: Upload Linux .zip ARM64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-linux-arm64-portable.zip
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-arm64.zip
|
|
|
|
- name: Upload Linux .7z ARM64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-linux-arm64-portable.7z
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-arm64.7z
|
|
|
|
- name: Upload .deb x64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
|
with:
|
|
name: freetube_${{ steps.versionNumber.outputs.version }}_amd64.deb
|
|
path: build/freetube_${{ steps.versionNumber.outputs.version }}_amd64.deb
|
|
|
|
- name: Upload .deb ARMv7l Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
|
|
with:
|
|
name: freetube_${{ steps.versionNumber.outputs.version }}_armv7l.deb
|
|
path: build/freetube_${{ steps.versionNumber.outputs.version }}_armv7l.deb
|
|
|
|
- name: Upload .deb ARM64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
|
with:
|
|
name: freetube_${{ steps.versionNumber.outputs.version }}_arm64.deb
|
|
path: build/freetube_${{ steps.versionNumber.outputs.version }}_arm64.deb
|
|
|
|
- name: Upload AppImage x64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-amd64.AppImage
|
|
path: build/FreeTube-${{ steps.versionNumber.outputs.version }}.AppImage
|
|
|
|
- name: Upload AppImage ARMv7l Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-armv7l')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-armv7l.AppImage
|
|
path: build/FreeTube-${{ steps.versionNumber.outputs.version }}-armv7l.AppImage
|
|
|
|
- name: Upload AppImage ARM64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-arm64.AppImage
|
|
path: build/FreeTube-${{ steps.versionNumber.outputs.version }}-arm64.AppImage
|
|
|
|
- name: Upload .rpm x64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}.amd64.rpm
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}.x86_64.rpm
|
|
|
|
# rpm are not built for armv7l
|
|
|
|
- name: Upload .rpm ARM64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}.arm64.rpm
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}.aarch64.rpm
|
|
|
|
- name: Upload Pacman .pacman x64 Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.runtime, 'linux-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-amd64.pacman
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}.pacman
|
|
|
|
- name: Upload Windows x64 .exe Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-setup-x64.exe
|
|
path: build/freetube Setup ${{ steps.versionNumber.outputs.version }}.exe
|
|
|
|
- name: Upload Windows x64 Portable Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-win-x64-portable.exe
|
|
path: build/freetube ${{ steps.versionNumber.outputs.version }}.exe
|
|
|
|
- name: Upload Windows x64 .zip Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-win-x64-portable.zip
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-win.zip
|
|
|
|
- name: Upload Windows x64 .7z Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-win-x64-portable.7z
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-win.7z
|
|
|
|
- name: Upload Windows arm64 .exe Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-setup-arm64.exe
|
|
path: build/freetube Setup ${{ steps.versionNumber.outputs.version }}.exe
|
|
|
|
- name: Upload Windows arm64 Portable Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-win-arm64-portable.exe
|
|
path: build/freetube ${{ steps.versionNumber.outputs.version }}.exe
|
|
|
|
- name: Upload Windows arm64 .zip Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-win-arm64-portable.zip
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-arm64-win.zip
|
|
|
|
- name: Upload Windows arm64 .7z Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'windows') && startsWith(matrix.runtime, 'win-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-win-arm64-portable.7z
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-arm64-win.7z
|
|
|
|
- name: Upload Mac x64 .dmg Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-mac-x64.dmg
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}.dmg
|
|
|
|
- name: Upload Mac x64 .zip Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-mac-x64.zip
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-mac.zip
|
|
|
|
- name: Upload Mac x64 .7z Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-x64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-mac-x64.7z
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-mac.7z
|
|
|
|
- name: Upload Mac arm64 .dmg Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-mac-arm64.dmg
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-arm64.dmg
|
|
|
|
- name: Upload Mac arm64 .zip Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-mac-arm64.zip
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-arm64-mac.zip
|
|
|
|
- name: Upload Mac arm64 .7z Artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
|
|
if: startsWith(matrix.os, 'macos') && startsWith(matrix.runtime, 'osx-arm64')
|
|
with:
|
|
name: freetube-${{ steps.versionNumber.outputs.version }}-mac-arm64.7z
|
|
path: build/freetube-${{ steps.versionNumber.outputs.version }}-arm64-mac.7z
|
|
|
|
- name: Save pnpm cache
|
|
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
|
|
# Only save the cache if we weren't able to restore an existing one above
|
|
if: steps.restore_cache.outputs.cache-primary-key != steps.restore_cache.outputs.cache-matched-key
|
|
with:
|
|
key: ${{ steps.restore_cache.outputs.cache-primary-key }}
|
|
path: ${{ steps.cache_dir.outputs.cache_dir }}
|