name: "publish" on: workflow_dispatch: jobs: get-version: runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.version }} body: ${{ steps.version.outputs.body }} steps: - uses: actions/checkout@v4 - id: version run: | echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT echo "body<> "$GITHUB_OUTPUT" cat RELEASE_NOTES.md >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" publish-tauri: needs: get-version permissions: contents: write strategy: fail-fast: false matrix: include: - platform: "macos-latest" args: "--target aarch64-apple-darwin" - platform: "macos-latest" args: "--target x86_64-apple-darwin" - platform: "ubuntu-22.04" args: "" - platform: "windows-latest" args: "" runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v4 - name: install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libudev-dev - name: setup pnpm uses: pnpm/action-setup@v4 with: version: 10 - name: setup node uses: actions/setup-node@v4 with: node-version: lts/* cache: "pnpm" - name: install Rust stable uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - name: Rust cache uses: swatinem/rust-cache@v2 with: workspaces: "./src-tauri -> target" - name: install frontend dependencies run: pnpm install - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} with: tagName: v__VERSION__ releaseName: "Emerald v__VERSION__" releaseBody: ${{ needs.get-version.outputs.body }} releaseDraft: true prerelease: false uploadUpdaterJson: true args: ${{ matrix.args }} build-appimage: runs-on: ubuntu-latest container: image: archlinux:latest steps: - name: Bootstrap keyring and git run: | pacman -Syu --noconfirm archlinux-keyring pacman -S --noconfirm --needed git - uses: actions/checkout@v4 with: submodules: true - uses: actions/cache@v4 with: path: | src-tauri/target node_modules /var/cache/pacman/pkg key: arch-${{ hashFiles('src-tauri/Cargo.lock', 'pnpm-lock.yaml') }} restore-keys: arch- - name: Install build dependencies run: | pacman -S --noconfirm --needed \ base-devel wget zsync nodejs patchelf \ cargo cargo-tauri \ gtk3 libayatana-appindicator webkit2gtk-4.1 glib-networking librsvg \ xorg-server-xvfb - name: setup pnpm uses: pnpm/action-setup@v4 with: version: 10 - name: Build deb with tauri run: | pnpm install cargo-tauri build --bundles deb --config '{"bundle":{"createUpdaterArtifacts":false},"build":{"beforeBuildCommand":"pnpm build"}}' - name: Extract deb into /usr run: | cd src-tauri/target/release/bundle/deb ar x ./*.deb tar -xf data.tar.* cp -a usr/. /usr/ - name: Build AppImage run: | cd pkg/AppImage chmod +x ./AppImage.sh ./AppImage.sh - uses: actions/upload-artifact@v4 with: name: appimage path: pkg/AppImage/dist/*.AppImage* #neo: *.AppImage* because .zsync as well publish-flatpak: needs: [get-version, build-appimage] runs-on: ubuntu-latest permissions: contents: write container: image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08 options: --privileged steps: - uses: actions/checkout@v4 with: submodules: true - name: sleep for 20 seconds run: sleep 20 - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 with: bundle: emerald.flatpak manifest-path: flatpak/io.github.Emerald_Legacy_Launcher.Emerald_Legacy_Launcher.yml cache-key: flatpak-builder-${{ github.sha }} - uses: actions/download-artifact@v4 with: name: appimage path: appimage - uses: softprops/action-gh-release@v2 with: body: ${{ needs.get-version.outputs.body }} tag_name: v${{ needs.get-version.outputs.version }} files: | emerald.flatpak appimage/*.AppImage* draft: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}