diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98d04e8b3..35ed282b3 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,6 +43,14 @@ jobs: env: REGISTRY: ghcr.io OWNER: andrew-codes + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm/v6 + - linux/arm/v7 + - linux/arm64 steps: - uses: actions/checkout@v4 - name: Extract major release version from package.json @@ -74,16 +82,16 @@ jobs: registry: ${{ env.REGISTRY}} username: ${{ env.OWNER }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Publish apps run: yarn nx run-many --target=publish --parallel --verbose env: NODE_ENV: production DEBUG: 'playnite-web/*' - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packaged-apps - path: apps/*/_packaged/** + PLATFORM: ${{ matrix.platform }} unit_tests_windows: name: Verify PR - Tests (Windows) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 6ff624cea..760356f2f 100755 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -47,6 +47,14 @@ jobs: OWNER: andrew-codes REPO_NAME: playnite-web runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm/v6 + - linux/arm/v7 + - linux/arm64 steps: - name: Checkout @@ -80,10 +88,15 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ env.OWNER }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Publish specific version for apps run: yarn nx run-many --target=publish --parallel --verbose --all env: NODE_ENV: production + PLATFORM: ${{ matrix.platform }} package: name: Publish Extension @@ -122,11 +135,6 @@ jobs: NODE_ENV: production - name: Move artifacts run: mkdir -p _packaged && mv apps/*/_packaged/** _packaged/ - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: playnite-extension - path: _packaged/** release: name: Release diff --git a/.github/workflows/pull-request-release.yml b/.github/workflows/pull-request-release.yml index 456aae908..d6ce10dd7 100755 --- a/.github/workflows/pull-request-release.yml +++ b/.github/workflows/pull-request-release.yml @@ -48,6 +48,14 @@ jobs: REGISTRY: ghcr.io OWNER: andrew-codes REPO_NAME: playnite-web + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm/v6 + - linux/arm/v7 + - linux/arm64 steps: - uses: actions/checkout@v4 with: @@ -75,17 +83,16 @@ jobs: run: corepack enable && corepack prepare --activate yarn@${{ steps.yarn_version.outputs.value }} - name: Install deps run: yarn + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Publish apps run: yarn nx affected --base=origin/main --head=HEAD --target=package --parallel --verbose --exclude='*,!tag:linux' env: NODE_ENV: production - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: packaged-apps - path: apps/*/_packaged/** + DEBUG: 'playnite-web/*' + PLATFORM: ${{ matrix.platform }} unit_tests_windows: name: Verify PR - Tests (Windows) diff --git a/apps/game-db-updater/scripts/package.ts b/apps/game-db-updater/scripts/package.ts index 6c6847a0a..fa063a147 100755 --- a/apps/game-db-updater/scripts/package.ts +++ b/apps/game-db-updater/scripts/package.ts @@ -5,7 +5,7 @@ import pkg from '../package.json' async function run() { sh.cp('-R', '.dist/', '_packaged/') - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables') @@ -15,7 +15,7 @@ async function run() { for (const tag of tags) { sh.exec( - `docker build --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile .`, + `docker build --platform ${PLATFORM} --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile .`, ) } } diff --git a/apps/game-db-updater/scripts/publish.ts b/apps/game-db-updater/scripts/publish.ts index 9f4e9af45..3483420f9 100755 --- a/apps/game-db-updater/scripts/publish.ts +++ b/apps/game-db-updater/scripts/publish.ts @@ -3,7 +3,7 @@ import { getDockerTags } from 'versioning' import pkg from '../package.json' async function run() { - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables') diff --git a/apps/playnite-web/scripts/package.js b/apps/playnite-web/scripts/package.js index e2a3cd2b0..008b6b8f8 100755 --- a/apps/playnite-web/scripts/package.js +++ b/apps/playnite-web/scripts/package.js @@ -7,7 +7,7 @@ async function run() { sh.cp('server.production.js', '_packaged/') sh.cp('-R', 'public/', '_packaged/') - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables') @@ -17,7 +17,7 @@ async function run() { for (const tag of tags) { sh.exec( - `docker build --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile .`, + `docker build --platform ${PLATFORM} --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile .`, ) } } diff --git a/apps/playnite-web/scripts/publish.js b/apps/playnite-web/scripts/publish.js index 5bfff597e..bebd03b7a 100755 --- a/apps/playnite-web/scripts/publish.js +++ b/apps/playnite-web/scripts/publish.js @@ -3,7 +3,7 @@ import { getDockerTags } from 'versioning' import pkg from '../package.json' assert { type: 'json' } async function run() { - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables') diff --git a/hass-game-db-updater/scripts/package.ts b/hass-game-db-updater/scripts/package.ts index acc7f09c0..0cf08fcb0 100755 --- a/hass-game-db-updater/scripts/package.ts +++ b/hass-game-db-updater/scripts/package.ts @@ -5,7 +5,7 @@ import pkg from '../package.json' async function run() { sh.cp('-R', '.dist/', '_packaged/') - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables') @@ -15,7 +15,7 @@ async function run() { for (const tag of tags) { sh.exec( - `docker build --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile --build-arg VERSION=${tag} .`, + `docker build --platform ${PLATFORM} --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile --build-arg VERSION=${tag} .`, ) } } diff --git a/hass-game-db-updater/scripts/publish.ts b/hass-game-db-updater/scripts/publish.ts index 9f4e9af45..3483420f9 100755 --- a/hass-game-db-updater/scripts/publish.ts +++ b/hass-game-db-updater/scripts/publish.ts @@ -3,7 +3,7 @@ import { getDockerTags } from 'versioning' import pkg from '../package.json' async function run() { - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables') diff --git a/hass-playnite-web/scripts/package.ts b/hass-playnite-web/scripts/package.ts index acc7f09c0..0cf08fcb0 100755 --- a/hass-playnite-web/scripts/package.ts +++ b/hass-playnite-web/scripts/package.ts @@ -5,7 +5,7 @@ import pkg from '../package.json' async function run() { sh.cp('-R', '.dist/', '_packaged/') - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables') @@ -15,7 +15,7 @@ async function run() { for (const tag of tags) { sh.exec( - `docker build --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile --build-arg VERSION=${tag} .`, + `docker build --platform ${PLATFORM} --tag "${REGISTRY}/${OWNER}/${pkg.name}:${tag}" --file Dockerfile --build-arg VERSION=${tag} .`, ) } } diff --git a/hass-playnite-web/scripts/publish.ts b/hass-playnite-web/scripts/publish.ts index 9f4e9af45..3483420f9 100755 --- a/hass-playnite-web/scripts/publish.ts +++ b/hass-playnite-web/scripts/publish.ts @@ -3,7 +3,7 @@ import { getDockerTags } from 'versioning' import pkg from '../package.json' async function run() { - const { REGISTRY, OWNER, GITHUB_REF } = process.env + const { REGISTRY, OWNER, GITHUB_REF, PLATFORM } = process.env if (!REGISTRY || !OWNER || !GITHUB_REF) { throw new Error('Missing environment variables')