117 lines
4.0 KiB
YAML
117 lines
4.0 KiB
YAML
name: release
|
|
on:
|
|
push:
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Install Linux build deps
|
|
# media_kit_video links libmpv + epoxy via pkg-config. Runner images
|
|
# differ: some run as root without sudo.
|
|
run: |
|
|
SUDO=sudo; [ "$(id -u)" = 0 ] && SUDO=
|
|
$SUDO apt-get update
|
|
$SUDO apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev \
|
|
liblzma-dev g++ libmpv-dev libepoxy-dev xz-utils unzip curl python3
|
|
|
|
- name: Setup Flutter (stable)
|
|
run: |
|
|
git clone https://github.com/flutter/flutter.git -b stable --depth 1 ~/flutter
|
|
echo "$HOME/flutter/bin" >> $GITHUB_PATH
|
|
|
|
- name: Build tarball
|
|
run: tool/package_linux.sh
|
|
|
|
- name: Publish release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
run: |
|
|
VER="${GITHUB_REF_NAME#v}"
|
|
dart tool/release_publish.dart "$GITHUB_REF_NAME" "dist/watch-together-$VER-linux-x64.tar.gz"
|
|
|
|
arch:
|
|
runs-on: ubuntu-latest
|
|
container: archlinux:latest
|
|
steps:
|
|
- name: Install Arch build deps
|
|
run: |
|
|
pacman -Syu --noconfirm --needed base-devel clang cmake flutter git \
|
|
gtk3 libepoxy mpv ninja pkgconf
|
|
|
|
- name: Checkout
|
|
run: |
|
|
git init -q .
|
|
git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git"
|
|
git fetch -q --tags origin "$GITHUB_SHA"
|
|
git checkout -q --force FETCH_HEAD
|
|
|
|
- name: Build Arch package
|
|
run: |
|
|
useradd --create-home builder
|
|
chown -R builder .
|
|
runuser -u builder -- sh -c \
|
|
'cd deploy/arch && makepkg --cleanbuild --noconfirm --nodeps'
|
|
|
|
- name: Publish Arch package
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
run: |
|
|
TOKEN="${RELEASE_TOKEN:-${GITHUB_TOKEN:-$GITEA_TOKEN}}"
|
|
test -n "$TOKEN"
|
|
set -- deploy/arch/*.pkg.tar.zst
|
|
test -f "$1"
|
|
curl --fail --show-error --request PUT \
|
|
--header "Authorization: token $TOKEN" \
|
|
--upload-file "$1" \
|
|
"$GITHUB_API_URL/packages/$GITHUB_REPOSITORY_OWNER/arch/core/x86_64"
|
|
|
|
windows:
|
|
# yuuka-windows: host-mode runner (no containers), runs as SYSTEM, has
|
|
# git + VS 2022 Build Tools but no bash/python — PowerShell and Dart
|
|
# only. Checkout is plain git: that host's cached actions/checkout
|
|
# clone was corrupt, and no `uses:` means no action cache to rot.
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout
|
|
shell: powershell
|
|
run: |
|
|
git init -q .
|
|
git remote add origin "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY.git"
|
|
git fetch -q --tags origin "$env:GITHUB_SHA"
|
|
if ($LASTEXITCODE) { exit 1 }
|
|
git checkout -q --force FETCH_HEAD
|
|
|
|
- name: Setup Flutter
|
|
shell: powershell
|
|
run: powershell -NoProfile -ExecutionPolicy Bypass -File tool/setup_flutter_windows.ps1
|
|
|
|
- name: Build zip
|
|
shell: powershell
|
|
run: powershell -NoProfile -ExecutionPolicy Bypass -File tool/package_windows.ps1
|
|
|
|
- name: Publish release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
shell: powershell
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
run: |
|
|
$Ver = $env:GITHUB_REF_NAME.TrimStart('v')
|
|
dart tool/release_publish.dart $env:GITHUB_REF_NAME "dist/watch-together-$Ver-windows-x64.zip"
|
|
if ($LASTEXITCODE) { exit 1 }
|