ci: add building and pushing to PPA
This commit is contained in:
parent
085081fd27
commit
d26b5035e0
|
|
@ -13,20 +13,23 @@ on:
|
||||||
# https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/
|
# https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux-x64:
|
test-build-linux-x64:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: "Checkout 🥡"
|
||||||
- uses: subosito/flutter-action@v2
|
uses: actions/checkout@v4
|
||||||
|
- name: "Install Flutter 🦋"
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: stable
|
channel: stable
|
||||||
architecture: x64
|
architecture: x64
|
||||||
flutter-version-file: pubspec.yaml
|
flutter-version-file: pubspec.yaml
|
||||||
- name: Install system dependencies 📦️
|
- name: "Install dependencies 💾"
|
||||||
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5
|
run: |
|
||||||
|
sudo apt-get -y install clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5
|
||||||
- name: Install Flutter dependencies 🦋
|
- name: Install Flutter dependencies 🦋
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Enable Linux build 🐧
|
- name: Enable Linux Desktop 🐧
|
||||||
run: flutter config --enable-linux-desktop
|
run: flutter config --enable-linux-desktop
|
||||||
- name: Build artifacts 🏗️
|
- name: Build artifacts 🏗️
|
||||||
run: flutter build linux --release
|
run: flutter build linux --release
|
||||||
|
|
@ -39,15 +42,77 @@ jobs:
|
||||||
path: build/linux/x64/release/bundle
|
path: build/linux/x64/release/bundle
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
build-with-nix:
|
test-build-ppa-x64:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: "Checkout 🥡"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: "Install Flutter 🦋"
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: stable
|
||||||
|
architecture: x64
|
||||||
|
flutter-version-file: pubspec.yaml
|
||||||
|
- name: "Install dependencies 💾"
|
||||||
|
run: |
|
||||||
|
sudo apt-get -y install clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5
|
||||||
|
sudo apt-get -y install debhelper-compat distro-info dput devscripts rsync
|
||||||
|
- name: Install Flutter dependencies 🦋
|
||||||
|
run: flutter pub get
|
||||||
|
- name: Enable Linux Desktop 🐧
|
||||||
|
run: flutter config --enable-linux-desktop
|
||||||
|
- name: Build artifacts 🏗️
|
||||||
|
run: flutter build linux --release
|
||||||
|
- name: "Import gpg key 🔑"
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
|
passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
|
||||||
|
- name: "Upload to PPA ⤴️"
|
||||||
|
env:
|
||||||
|
DEBEMAIL: ${{ secrets.DEBEMAIL }}
|
||||||
|
DEBFULLNAME: ${{ secrets.DEBFULLNAME }}
|
||||||
|
run: |
|
||||||
|
# Version variables
|
||||||
|
DEB_VER=$(grep "^version" pubspec.yaml | cut -d' ' -f2 | sed 's/+/-/')
|
||||||
|
TAR_VER=$(grep "^version" pubspec.yaml | cut -d' ' -f2 | sed 's/+.*//')
|
||||||
|
STAMP=$(date +%y%j.%H%M)
|
||||||
|
# Create a "fake" orig.tar.xz
|
||||||
|
mkdir -p ubuntu/build
|
||||||
|
cp -a build/linux/x64/release/bundle/* ubuntu/build/
|
||||||
|
cp -a assets/resources/quickgui.desktop ubuntu/build/
|
||||||
|
for SIZE in 16 32 48 64 128 256 512; do
|
||||||
|
mkdir -p ubuntu/build/icons/hicolor/${SIZE}x${SIZE}/apps/
|
||||||
|
cp -av assets/resources/quickgui_${SIZE}.png ubuntu/build/icons/hicolor/${SIZE}x${SIZE}/apps/quickgui.png
|
||||||
|
done
|
||||||
|
tar cvf "ubuntu/quickgui_${TAR_VER}.orig.tar" --directory ubuntu/build .
|
||||||
|
xz -vv -fz "ubuntu/quickgui_${TAR_VER}.orig.tar"
|
||||||
|
# Make a debian "source" package
|
||||||
|
mkdir -p ubuntu/build/debian
|
||||||
|
cp -a linux/packaging/debian/* ubuntu/build/debian/
|
||||||
|
sed -i 's/Architecture: any/Architecture: amd64/g' ubuntu/build/debian/control
|
||||||
|
cd ubuntu/build
|
||||||
|
for CODENAME in $(distro-info --supported); do
|
||||||
|
rm debian/changelog
|
||||||
|
dch --package quickgui --newversion="${DEB_VER}~${CODENAME}${STAMP}" --distribution=${CODENAME} "New upstream release." --create
|
||||||
|
dpkg-buildpackage -d -S -sa
|
||||||
|
#dput ppa:flexiondotorg/rubbish ../quickgui_${DEB_VER}~${CODENAME}${STAMP}_source.changes
|
||||||
|
done
|
||||||
|
- name: Show artifacts 👀
|
||||||
|
run: tree ubuntu/
|
||||||
|
|
||||||
|
test-build-nix-x64:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
id-token: "write"
|
id-token: "write"
|
||||||
contents: "read"
|
contents: "read"
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- name: "Checkout 🥡"
|
||||||
- uses: "DeterminateSystems/nix-installer-action@v12"
|
uses: "actions/checkout@v4"
|
||||||
- uses: "DeterminateSystems/magic-nix-cache-action@v7"
|
- name: "Install Nix ❄️"
|
||||||
|
uses: "DeterminateSystems/nix-installer-action@v12"
|
||||||
|
- name: "Enable Magic Nix Cache 🪄"
|
||||||
|
uses: "DeterminateSystems/magic-nix-cache-action@v7"
|
||||||
- name: "Build with Nix ❄️"
|
- name: "Build with Nix ❄️"
|
||||||
run: |
|
run: |
|
||||||
nix build .#quickgui
|
nix build .#quickgui
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
name: Publish Quickgui 🏷️
|
name: Publish Quickgui 🏷️
|
||||||
|
# To release a new version:
|
||||||
|
# - Make sure pubspec.yaml version: has been revved and is in the format "X.Y.Z+n"
|
||||||
|
# - Create a git tag with the format "X.Y.Z" and push it
|
||||||
|
# - The build and publish will run automatically if the git tag matches the
|
||||||
|
# pubspec.yaml version without the +n suffix
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
|
|
@ -27,9 +31,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
APP_VERSION=$(grep "^version" pubspec.yaml | cut -d' ' -f2)
|
APP_VERSION=$(grep "^version" pubspec.yaml | cut -d' ' -f2 | sed 's/+.*//')
|
||||||
GIT_VERSION=$(git describe --tags | cut -d'-' -f1)
|
GIT_VERSION=$(git describe --tags | cut -d'-' -f1)
|
||||||
echo "App version: ${REL_VERSION}"
|
echo "App version: ${APP_VERSION}"
|
||||||
echo "Git version: ${GIT_VERSION}"
|
echo "Git version: ${GIT_VERSION}"
|
||||||
if [ "${APP_VERSION}" != "${GIT_VERSION}" ]; then
|
if [ "${APP_VERSION}" != "${GIT_VERSION}" ]; then
|
||||||
echo "ERROR! Version mismatch.";
|
echo "ERROR! Version mismatch.";
|
||||||
|
|
@ -41,31 +45,34 @@ jobs:
|
||||||
name: "Build Linux x64 🏗️"
|
name: "Build Linux x64 🏗️"
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: "Checkout 🥡"
|
||||||
- uses: subosito/flutter-action@v2
|
uses: actions/checkout@v4
|
||||||
|
- name: "Install Flutter 🦋"
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: stable
|
channel: stable
|
||||||
architecture: x64
|
architecture: x64
|
||||||
flutter-version-file: pubspec.yaml
|
flutter-version-file: pubspec.yaml
|
||||||
- name: Install system dependencies 📦️
|
- name: Install system dependencies 📦️
|
||||||
run: sudo apt-get install -y clang cmake libblkid1 liblzma5 libgtk-3-0 libgtk-3-dev ninja-build pkg-config
|
run: |
|
||||||
|
sudo apt-get -y install clang cmake libblkid1 liblzma5 libgtk-3-0 libgtk-3-dev ninja-build pkg-config
|
||||||
- name: Install Flutter dependencies 🦋
|
- name: Install Flutter dependencies 🦋
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
- name: Activate flutter_distributor 🚀
|
- name: Activate flutter_distributor 🚀
|
||||||
run: dart pub global activate flutter_distributor
|
run: dart pub global activate flutter_distributor
|
||||||
- name: Build AppImage 🐧
|
- name: Build AppImage 🐧
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y libfuse-dev locate
|
sudo apt-get -y install libfuse-dev locate
|
||||||
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O /usr/local/bin/appimagetool
|
wget -q "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O /usr/local/bin/appimagetool
|
||||||
chmod +x /usr/local/bin/appimagetool
|
chmod +x /usr/local/bin/appimagetool
|
||||||
flutter_distributor package --platform=linux --targets=appimage
|
flutter_distributor package --platform=linux --targets=appimage
|
||||||
- name: Build .deb 🍥
|
- name: Build .deb 🍥
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y dpkg
|
sudo apt-get -y install dpkg
|
||||||
flutter_distributor package --platform=linux --targets=deb
|
flutter_distributor package --platform=linux --targets=deb
|
||||||
- name: Build .rpm 🎩
|
- name: Build .rpm 🎩
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y patchelf rpm
|
sudo apt-get -y install patchelf rpm
|
||||||
flutter_distributor package --platform=linux --targets=rpm
|
flutter_distributor package --platform=linux --targets=rpm
|
||||||
- name: Build .zip 🤐
|
- name: Build .zip 🤐
|
||||||
run: flutter_distributor package --platform=linux --targets=zip
|
run: flutter_distributor package --platform=linux --targets=zip
|
||||||
|
|
@ -110,3 +117,63 @@ jobs:
|
||||||
visibility: "public"
|
visibility: "public"
|
||||||
name: "quickemu-project/quickgui"
|
name: "quickemu-project/quickgui"
|
||||||
tag: "${{ inputs.tag }}"
|
tag: "${{ inputs.tag }}"
|
||||||
|
|
||||||
|
publish-ppa-x64:
|
||||||
|
needs: [version-check]
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: "Checkout 🥡"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: "Install Flutter 🦋"
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: stable
|
||||||
|
architecture: x64
|
||||||
|
flutter-version-file: pubspec.yaml
|
||||||
|
- name: "Install dependencies 💾"
|
||||||
|
run: |
|
||||||
|
sudo apt-get -y install clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5
|
||||||
|
sudo apt-get -y install debhelper-compat distro-info dput devscripts rsync
|
||||||
|
- name: Install Flutter dependencies 🦋
|
||||||
|
run: flutter pub get
|
||||||
|
- name: Enable Linux Desktop 🐧
|
||||||
|
run: flutter config --enable-linux-desktop
|
||||||
|
- name: Build artifacts 🏗️
|
||||||
|
run: flutter build linux --release
|
||||||
|
- name: "Import gpg key 🔑"
|
||||||
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
|
with:
|
||||||
|
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
|
||||||
|
passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
|
||||||
|
- name: "Upload to PPA ⤴️"
|
||||||
|
env:
|
||||||
|
DEBEMAIL: ${{ secrets.DEBEMAIL }}
|
||||||
|
DEBFULLNAME: ${{ secrets.DEBFULLNAME }}
|
||||||
|
run: |
|
||||||
|
# Version variables
|
||||||
|
DEB_VER=$(grep "^version" pubspec.yaml | cut -d' ' -f2 | sed 's/+/-/')
|
||||||
|
TAR_VER=$(grep "^version" pubspec.yaml | cut -d' ' -f2 | sed 's/+.*//')
|
||||||
|
STAMP=$(date +%y%j.%H%M)
|
||||||
|
# Create a "fake" orig.tar.xz
|
||||||
|
mkdir -p ubuntu/build
|
||||||
|
cp -a build/linux/x64/release/bundle/* ubuntu/build/
|
||||||
|
cp -a assets/resources/quickgui.desktop ubuntu/build/
|
||||||
|
for SIZE in 16 32 48 64 128 256 512; do
|
||||||
|
mkdir -p ubuntu/build/icons/hicolor/${SIZE}x${SIZE}/apps/
|
||||||
|
cp -av assets/resources/quickgui_${SIZE}.png ubuntu/build/icons/hicolor/${SIZE}x${SIZE}/apps/quickgui.png
|
||||||
|
done
|
||||||
|
tar cvf "ubuntu/quickgui_${TAR_VER}.orig.tar" --directory ubuntu/build .
|
||||||
|
xz -vv -fz "ubuntu/quickgui_${TAR_VER}.orig.tar"
|
||||||
|
# Make a debian "source" package
|
||||||
|
mkdir -p ubuntu/build/debian
|
||||||
|
cp -a linux/packaging/debian/* ubuntu/build/debian/
|
||||||
|
sed -i 's/Architecture: any/Architecture: amd64/g' ubuntu/build/debian/control
|
||||||
|
cd ubuntu/build
|
||||||
|
for CODENAME in $(distro-info --supported); do
|
||||||
|
rm debian/changelog
|
||||||
|
dch --package quickgui --newversion="${DEB_VER}~${CODENAME}${STAMP}" --distribution=${CODENAME} "New upstream release." --create
|
||||||
|
dpkg-buildpackage -d -S -sa
|
||||||
|
dput ppa:flexiondotorg/quickemu ../quickgui_${DEB_VER}~${CODENAME}${STAMP}_source.changes
|
||||||
|
done
|
||||||
|
- name: Show artifacts 👀
|
||||||
|
run: tree ubuntu/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue