| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- name: Build
- on:
- push:
- branches: [main]
- tags: ['v*']
- pull_request:
- workflow_dispatch:
- jobs:
- steamworks-vote:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v7
- - uses: actions/setup-node@v7
- with:
- node-version: 22
- - name: Install clang for bindgen
- run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
- - name: Build patched steamworks.js
- env:
- STEAMWORKSJS_BUILD: build
- run: bash patches/steamworks-vote/build.sh "$RUNNER_TEMP/src"
- - name: Pack
- run: |
- mkdir -p "$RUNNER_TEMP/out"
- cd "$RUNNER_TEMP/src/steamworksjs"
- npm pack --pack-destination "$RUNNER_TEMP/out"
- cp dist/linux64/steamworksjs.linux-x64-gnu.node dist/linux64/libsteam_api.so "$RUNNER_TEMP/out/"
- - uses: actions/upload-artifact@v7
- with:
- name: steamworks-vote
- path: ${{ runner.temp }}/out/*
- if-no-files-found: error
- we-manager:
- needs: steamworks-vote
- # still build the app when the patch build breaks, it just falls back to unconfirmed votes then
- if: ${{ !cancelled() }}
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v7
- - uses: actions/setup-node@v7
- with:
- node-version: 22
- cache: npm
- - run: npm ci
- - uses: actions/download-artifact@v8
- if: ${{ needs.steamworks-vote.result == 'success' }}
- with:
- name: steamworks-vote
- path: ${{ runner.temp }}/steamworks-vote
- - name: Use patched steamworks.js
- if: ${{ needs.steamworks-vote.result == 'success' }}
- run: npm install --no-save "$RUNNER_TEMP"/steamworks-vote/steamworks.js-*.tgz
- - run: npm run build
- - run: npx electron-builder --linux --publish never
- - uses: actions/upload-artifact@v7
- with:
- name: we-manager
- path: |
- dist/*.AppImage
- dist/*.deb
- if-no-files-found: error
- # the app's .deb plus the engine's latest portable release, see packaging/flatpak
- flatpak:
- needs: we-manager
- runs-on: ubuntu-latest
- container:
- image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-25.08
- options: --privileged
- steps:
- - uses: actions/checkout@v7
- - uses: actions/download-artifact@v8
- with:
- name: we-manager
- path: ${{ runner.temp }}/we-manager
- - name: Collect sources
- run: |
- cp "$RUNNER_TEMP"/we-manager/*.deb packaging/flatpak/we-manager.deb
- url=$(curl -fsSL https://api.github.com/repos/WallpaperEngineLover/linux-wallpaperengine-kde/releases/latest |
- jq -r '.assets[] | select(.name == "linux-wallpaperengine-kde-portable-x86_64.tar.gz") | .browser_download_url')
- [ -n "$url" ] || { echo "the latest linux-wallpaperengine-kde release has no portable tarball"; exit 1; }
- curl -fL "$url" -o packaging/flatpak/linux-wallpaperengine-kde-portable-x86_64.tar.gz
- - uses: flatpak/flatpak-github-actions/flatpak-builder@v6
- with:
- bundle: we-manager.flatpak
- manifest-path: packaging/flatpak/io.github.WallpaperEngineLover.we_manager.yml
- cache-key: flatpak-builder-${{ github.sha }}
- upload-artifact: false
- - uses: actions/upload-artifact@v7
- with:
- name: we-manager-flatpak
- path: we-manager.flatpak
- if-no-files-found: error
- release:
- needs: [steamworks-vote, we-manager, flatpak]
- if: ${{ !cancelled() && startsWith(github.ref, 'refs/tags/v') && needs.we-manager.result == 'success' }}
- runs-on: ubuntu-latest
- permissions:
- contents: write
- steps:
- - uses: actions/checkout@v7
- - name: Check tag matches package.json version
- run: |
- version=$(node -p "require('./package.json').version")
- if [ "v$version" != "$GITHUB_REF_NAME" ]; then
- echo "tag $GITHUB_REF_NAME does not match package.json version $version"
- exit 1
- fi
- - uses: actions/download-artifact@v8
- with:
- path: release
- merge-multiple: true
- - name: Create release
- env:
- GH_TOKEN: ${{ github.token }}
- run: |
- gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --generate-notes \
- release/*.AppImage release/*.deb $(ls release/steamworks.js-*.tgz release/*.flatpak 2>/dev/null)
- aur:
- needs: release
- runs-on: ubuntu-latest
- env:
- HAS_AUR_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY != '' }}
- steps:
- - uses: actions/checkout@v7
- - name: Set the version
- run: sed -i -e "s/^pkgver=.*/pkgver=${GITHUB_REF_NAME#v}/" -e "s/^pkgrel=.*/pkgrel=1/"
- packaging/aur/we-manager-bin/PKGBUILD
- - name: Publish we-manager-bin to the AUR
- if: env.HAS_AUR_KEY == 'true'
- uses: KSXGitHub/github-actions-deploy-aur@v4.1.1
- with:
- pkgname: we-manager-bin
- pkgbuild: ./packaging/aur/we-manager-bin/PKGBUILD
- updpkgsums: true
- commit_username: ${{ secrets.AUR_USERNAME }}
- commit_email: ${{ secrets.AUR_EMAIL }}
- ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
- commit_message: Update to ${{ github.ref_name }}
|