wip: tidy #5466
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build binaries | |
on: [push] | |
jobs: | |
check-types: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Prepare | |
run: | | |
corepack enable | |
# try and avoid timeout errors | |
yarn config set httpTimeout 100000 | |
yarn --immutable | |
yarn build:ts | |
- name: Check types (shared-lib) | |
run: | | |
cd shared-lib | |
yarn check-types | |
- name: Check types (server) | |
run: | | |
cd companion | |
yarn check-types | |
- name: Check types (client) | |
run: | | |
cd webui | |
yarn check-types | |
linux-x64: | |
runs-on: ubuntu-20.04 | |
needs: check-types | |
timeout-minutes: 20 | |
outputs: | |
version: ${{ steps.filenames.outputs.longversion }} | |
do-docker: ${{ steps.upload.outputs.branch }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Cache build sources | |
uses: actions/cache@v4 | |
with: | |
path: .cache | |
key: linux-x64-build-cache-${{ hashFiles('nodejs-versions.json') }} | |
- name: build & package | |
run: | | |
corepack enable | |
# try and avoid timeout errors | |
yarn config set httpTimeout 100000 | |
yarn --immutable | |
yarn zx tools/build/complete.mjs linux-x64 | |
# manually tar it, to preserve the symlinks | |
cd electron-output | |
mv linux-unpacked companion-x64 | |
tar -cvzf companion-x64.tar.gz companion-x64 | |
env: | |
CI: 1 | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
USE_HARD_LINKS: false | |
- name: Determine files to upload | |
id: filenames | |
shell: bash | |
run: | | |
VERSION=$(cat ./dist/BUILD) | |
echo "sourcename=electron-output/companion-x64.tar.gz" >> $GITHUB_OUTPUT | |
echo "targetname=companion-linux-x64-${VERSION}.tar.gz" >> $GITHUB_OUTPUT | |
echo "longversion=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Upload build | |
id: upload | |
uses: bitfocus/actions/upload-and-notify@main | |
with: | |
long-version: ${{ steps.filenames.outputs.longversion }} | |
beta-branch: main | |
dev-branch: develop | |
source-filename: ${{ steps.filenames.outputs.sourcename }} | |
destination-filename: ${{ steps.filenames.outputs.targetname }} | |
s3-host: ${{ secrets.S3_HOST }} | |
s3-bucket: ${{ secrets.S3_BUCKET }}/companion | |
s3-access-key: ${{ secrets.S3_KEY }} | |
s3-secret-key: ${{ secrets.S3_SECRET }} | |
api-product: companion | |
api-target: 'linux-tgz' | |
api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }} | |
linux-arm64: | |
runs-on: ubuntu-20.04 | |
needs: check-types | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Cache build sources | |
uses: actions/cache@v4 | |
with: | |
path: .cache | |
key: linux-arm64-build-cache-${{ hashFiles('nodejs-versions.json') }} | |
- name: build & package | |
run: | | |
corepack enable | |
# try and avoid timeout errors | |
yarn config set httpTimeout 100000 | |
yarn --immutable | |
yarn zx tools/build/complete.mjs linux-arm64 | |
# manually tar it, to preserve the symlinks | |
cd electron-output | |
mv linux-arm64-unpacked companion-arm64 | |
tar -cvzf companion-arm64.tar.gz companion-arm64 | |
env: | |
CI: 1 | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
SKIP_LAUNCH_CHECK: true | |
USE_HARD_LINKS: false | |
- name: Determine files to upload | |
id: filenames | |
shell: bash | |
run: | | |
VERSION=$(cat ./dist/BUILD) | |
echo "sourcename=electron-output/companion-arm64.tar.gz" >> $GITHUB_OUTPUT | |
echo "targetname=companion-linux-arm64-${VERSION}.tar.gz" >> $GITHUB_OUTPUT | |
echo "longversion=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Upload build | |
uses: bitfocus/actions/upload-and-notify@main | |
with: | |
long-version: ${{ steps.filenames.outputs.longversion }} | |
beta-branch: main | |
dev-branch: develop | |
source-filename: ${{ steps.filenames.outputs.sourcename }} | |
destination-filename: ${{ steps.filenames.outputs.targetname }} | |
s3-host: ${{ secrets.S3_HOST }} | |
s3-bucket: ${{ secrets.S3_BUCKET }}/companion | |
s3-access-key: ${{ secrets.S3_KEY }} | |
s3-secret-key: ${{ secrets.S3_SECRET }} | |
api-product: companion | |
api-target: 'linux-arm64-tgz' | |
api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }} | |
osx-x64: | |
runs-on: macos-13 | |
needs: check-types | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Cache build sources | |
uses: actions/cache@v4 | |
with: | |
path: .cache | |
key: macos-x64-build-cache-${{ hashFiles('nodejs-versions.json') }} | |
- name: build & package | |
run: | | |
corepack enable | |
# try and avoid timeout errors | |
yarn config set httpTimeout 100000 | |
yarn --immutable | |
yarn zx tools/build/complete.mjs darwin-x64 | |
env: | |
CI: 1 | |
CSC_LINK: ${{ secrets.OSX_CSC_LINK }} | |
CSC_KEY_PASSWORD: ${{ secrets.OSX_CSC_KEY_PASSWORD }} | |
APPLEID: ${{ secrets.APPLEID }} | |
APPLETEAMID: ${{ secrets.APPLETEAMID }} | |
APPLEIDPASS: ${{ secrets.APPLEIDPASS }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
USE_HARD_LINKS: false | |
- name: Determine files to upload | |
id: filenames | |
shell: bash | |
run: | | |
VERSION=$(cat ./dist/BUILD) | |
echo "sourcename=electron-output/companion-mac-x64.dmg" >> $GITHUB_OUTPUT | |
echo "targetname=companion-mac-x64-${VERSION}.dmg" >> $GITHUB_OUTPUT | |
echo "longversion=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Upload build | |
uses: bitfocus/actions/upload-and-notify@main | |
with: | |
long-version: ${{ steps.filenames.outputs.longversion }} | |
beta-branch: main | |
dev-branch: develop | |
source-filename: ${{ steps.filenames.outputs.sourcename }} | |
destination-filename: ${{ steps.filenames.outputs.targetname }} | |
s3-host: ${{ secrets.S3_HOST }} | |
s3-bucket: ${{ secrets.S3_BUCKET }}/companion | |
s3-access-key: ${{ secrets.S3_KEY }} | |
s3-secret-key: ${{ secrets.S3_SECRET }} | |
api-product: companion | |
api-target: 'mac-intel' | |
api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }} | |
osx-arm64: | |
runs-on: macos-13 | |
needs: check-types | |
timeout-minutes: 60 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Cache build sources | |
uses: actions/cache@v4 | |
with: | |
path: .cache | |
key: macos-arm64-build-cache-${{ hashFiles('nodejs-versions.json') }} | |
- name: prepare | |
run: | | |
corepack enable | |
# try and avoid timeout errors | |
yarn config set httpTimeout 100000 | |
yarn --immutable | |
env: | |
CI: 1 | |
- name: build & package | |
run: | | |
yarn zx tools/build/complete.mjs darwin-arm64 | |
env: | |
CI: 1 | |
CSC_LINK: ${{ secrets.OSX_CSC_LINK }} | |
CSC_KEY_PASSWORD: ${{ secrets.OSX_CSC_KEY_PASSWORD }} | |
APPLEID: ${{ secrets.APPLEID }} | |
APPLETEAMID: ${{ secrets.APPLETEAMID }} | |
APPLEIDPASS: ${{ secrets.APPLEIDPASS }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
USE_HARD_LINKS: false | |
SKIP_LAUNCH_CHECK: true | |
- name: Determine files to upload | |
id: filenames | |
shell: bash | |
run: | | |
VERSION=$(cat ./dist/BUILD) | |
echo "sourcename=electron-output/companion-mac-arm64.dmg" >> $GITHUB_OUTPUT | |
echo "targetname=companion-mac-arm64-${VERSION}.dmg" >> $GITHUB_OUTPUT | |
echo "longversion=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Upload build | |
uses: bitfocus/actions/upload-and-notify@main | |
with: | |
long-version: ${{ steps.filenames.outputs.longversion }} | |
beta-branch: main | |
dev-branch: develop | |
source-filename: ${{ steps.filenames.outputs.sourcename }} | |
destination-filename: ${{ steps.filenames.outputs.targetname }} | |
s3-host: ${{ secrets.S3_HOST }} | |
s3-bucket: ${{ secrets.S3_BUCKET }}/companion | |
s3-access-key: ${{ secrets.S3_KEY }} | |
s3-secret-key: ${{ secrets.S3_SECRET }} | |
api-product: companion | |
api-target: 'mac-arm' | |
api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }} | |
win32-x64: | |
runs-on: windows-2019 | |
needs: check-types | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
- name: Cache build sources | |
uses: actions/cache@v4 | |
with: | |
path: .cache | |
key: windows-x64-build-cache-${{ hashFiles('nodejs-versions.json') }} | |
- name: build & package | |
shell: bash | |
run: | | |
corepack enable | |
# try and avoid timeout errors | |
yarn config set httpTimeout 100000 | |
yarn --immutable | |
yarn zx tools/build/complete.mjs win32-x64 | |
env: | |
CI: 1 | |
CSC_LINK: ${{ secrets.CSC_LINK }} | |
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | |
SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
- name: Determine files to upload | |
id: filenames | |
shell: bash | |
run: | | |
VERSION=$(cat ./dist/BUILD) | |
echo "sourcename=electron-output/companion-win64.exe" >> $GITHUB_OUTPUT | |
echo "targetname=companion-win64-${VERSION}.exe" >> $GITHUB_OUTPUT | |
echo "longversion=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Upload build | |
uses: bitfocus/actions/upload-and-notify@main | |
with: | |
long-version: ${{ steps.filenames.outputs.longversion }} | |
beta-branch: main | |
dev-branch: develop | |
source-filename: ${{ steps.filenames.outputs.sourcename }} | |
destination-filename: ${{ steps.filenames.outputs.targetname }} | |
s3-host: ${{ secrets.S3_HOST }} | |
s3-bucket: ${{ secrets.S3_BUCKET }}/companion | |
s3-access-key: ${{ secrets.S3_KEY }} | |
s3-secret-key: ${{ secrets.S3_SECRET }} | |
api-product: companion | |
api-target: 'win-x64' | |
api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }} | |
docker-image: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: | |
- linux-x64 | |
- linux-arm64 | |
env: | |
IMAGE_NAME: companion | |
steps: | |
- name: Docker meta | |
if: ${{ needs.linux-x64.outputs.do-docker }} | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=raw,value=${{ needs.linux-x64.outputs.version }} | |
type=ref,event=tag | |
type=ref,event=branch | |
- name: Set up QEMU | |
if: ${{ steps.meta.outputs.tags }} | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
if: ${{ steps.meta.outputs.tags }} | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to registry | |
if: ${{ steps.meta.outputs.tags }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
if: ${{ steps.meta.outputs.tags }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
if: ${{ steps.meta.outputs.tags }} | |
env: | |
DOCKER_BUILD_SUMMARY: false | |
with: | |
context: . | |
file: Dockerfile.prebuild | |
platforms: linux/amd64,linux/arm64/v8 | |
push: true | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: '${{ steps.meta.outputs.tags }}' | |
build-args: | | |
build_name=${{ needs.linux-x64.outputs.version }} |