Update release.yml #47
This file contains hidden or 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: Release | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| permissions: | ||
| contents: write | ||
| jobs: | ||
| release-linux-noarch: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| persist-credentials: false | ||
| - name: Install strip-nondeterminism | ||
| run: sudo apt-get install strip-nondeterminism | ||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| - name: Clean cache | ||
| run: npm cache clean --force --loglevel=info | ||
| - name: Install dependencies | ||
| run: npm install --force --loglevel=info | ||
| - name: Fetch | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: npm run fetch | ||
| - name: Compile | ||
| run: npm run webpack:prod | ||
| - name: Package | ||
| run: | | ||
| node release-automation/build.js --debian --tarball --appimage --x64 --armv7l --arm64 --production | ||
| - name: Print file tree | ||
| run: node scripts/print-file-tree.js dist | ||
| - name: Upload artifacts to GitHub Actions | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: arch-conversion-artifacts | ||
| path: | | ||
| dist/*.deb | ||
| dist/*.tar.gz | ||
| dist/*.AppImage | ||
| convertarch.sh | ||
| retention-days: 1 | ||
| release-linux-includearch: | ||
| needs: release-linux-noarch | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: archlinux:base-devel | ||
| options: --privileged | ||
| steps: | ||
| - name: Prepare Arch environment | ||
| run: | | ||
| pacman -Syu --noconfirm | ||
| pacman -S --noconfirm sudo git base-devel namcap libarchive zstd | ||
| useradd -m -s /bin/bash builduser | ||
| echo "builduser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/builduser | ||
| echo 'export TERM=xterm' >> /etc/bash.bashrc | ||
| - name: Install and update debtap | ||
| run: | | ||
| sudo -u builduser bash <<'EOF' | ||
| set -e | ||
| export TERM=xterm | ||
| cd /home/builduser | ||
| git clone https://aur.archlinux.org/debtap.git | ||
| cd debtap | ||
| makepkg -si --noconfirm | ||
| EOF | ||
| debtap -u | ||
| debtap --version || true | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: arch-conversion-artifacts | ||
| path: /workspace | ||
| - name: Setup workspace | ||
| run: | | ||
| cd /workspace | ||
| ls -la | ||
| chmod +x convertarch.sh | ||
| mkdir -p dist | ||
| find . -name "*.deb" -exec mv {} dist/ \; 2>/dev/null || true | ||
| if [ -f "convertarch.sh" ]; then | ||
| cp convertarch.sh convertarch.sh.backup | ||
| sed -i 's/debtap/sudo debtap/g' convertarch.sh || true | ||
| fi | ||
| find dist -name "*.deb" | sort | ||
| - name: Convert packages | ||
| working-directory: /workspace | ||
| run: | | ||
| export TERM=xterm | ||
| ./convertarch.sh | ||
| - name: Verify packages | ||
| working-directory: /workspace | ||
| run: | | ||
| find . -name "*.pkg.tar.zst" -ls 2>/dev/null | head -10 || true | ||
| ls -la arch-packages/ 2>/dev/null || true | ||
| pwd | ||
| ls -la | ||
| - name: Upload packages | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: arch-linux-packages | ||
| path: | | ||
| /workspace/arch-packages/*.pkg.tar.zst | ||
| /workspace/dist/*.deb | ||
| /workspace/dist/*.tar.gz | ||
| /workspace/dist/*.AppImage | ||
| - name: Upload artifacts to tag | ||
| uses: xresloader/upload-to-github-release@2bcae85344d41e21f7fc4c47fa2ed68223afdb49 | ||
| with: | ||
| file: |- | ||
| /workspace/arch-packages/*.pkg.tar.zst | ||
| /workspace/dist/*.deb | ||
| /workspace/dist/*.tar.gz | ||
| /workspace/dist/*.AppImage | ||
| draft: false | ||
| release-mac: | ||
| runs-on: macos-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| persist-credentials: false | ||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| - name: Clean cache | ||
| run: npm cache clean --force --loglevel=info | ||
| - name: Install dependencies | ||
| run: npm install --force --loglevel=info | ||
| - name: Fetch | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: npm run fetch | ||
| - name: Compile | ||
| run: npm run webpack:prod | ||
| - name: Package | ||
| run: | | ||
| node release-automation/build.js --mac --universal | ||
| node release-automation/build.js --mac-legacy-10.13-10.14 --mac-legacy-10.15 --x64 | ||
| - name: Print file tree | ||
| run: node scripts/print-file-tree.js dist | ||
| - name: Upload artifacts to GitHub Actions | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: mac | ||
| path: dist/*.dmg | ||
| - name: Upload artifacts to tag | ||
| uses: xresloader/upload-to-github-release@2bcae85344d41e21f7fc4c47fa2ed68223afdb49 | ||
| with: | ||
| file: dist/*.dmg | ||
| draft: false | ||
| release-windows: | ||
| runs-on: windows-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| persist-credentials: false | ||
| path: repo | ||
| - name: Move repository to D: drive | ||
| run: | | ||
| Copy-Item -Path repo -Destination D:\repo -Recurse | ||
| Remove-Item -Path repo -Recurse -Force | ||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22 | ||
| - name: Configure npm to use D: drive | ||
| run: | | ||
| npm config set cache D:\npm-cache | ||
| npm config set prefix D:\npm-prefix | ||
| - name: Clean cache | ||
| run: npm cache clean --force --loglevel=info | ||
| - name: Install dependencies | ||
| working-directory: D:\repo | ||
| run: npm install --force --loglevel=info | ||
| - name: Fetch | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| working-directory: D:\repo | ||
| run: npm run fetch | ||
| - name: Compile | ||
| working-directory: D:\repo | ||
| run: npm run webpack:prod | ||
| - name: Package | ||
| working-directory: D:\repo | ||
| run: | | ||
| node release-automation/build.js --windows --microsoft-store --x64 --ia32 --arm64 --production | ||
| node release-automation/build.js --windows-portable --x64 --production | ||
| node release-automation/build.js --windows-legacy --ia32 --x64 --production | ||
| - name: Print file tree | ||
| working-directory: D:\repo | ||
| run: node scripts/print-file-tree.js dist | ||
| - name: Sign Windows application | ||
| working-directory: D:\repo | ||
| run: deepsigntool\sign_windows.cmd | ||
| - name: Upload signed artifacts to GitHub Actions | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-signed | ||
| path: D:\repo\windows_signed\*.exe | ||
| - name: Upload signed artifacts to tag | ||
| uses: xresloader/upload-to-github-release@2bcae85344d41e21f7fc4c47fa2ed68223afdb49 | ||
| with: | ||
| file: D:\repo\windows_signed\*.exe | ||
| draft: false | ||