Release v1.0.5 #6
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 AppImage | |
| on: | |
| pull_request: | |
| types: [closed] | |
| branches: | |
| - main | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-appimage: | |
| if: > | |
| (github.event_name == 'push') || | |
| (github.event_name == 'pull_request' && | |
| github.event.pull_request.merged == true && | |
| startsWith(github.event.pull_request.head.ref, 'release/')) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Resolve version tag | |
| id: version | |
| run: | | |
| if [[ "${{ github.event_name }}" == "push" ]]; then | |
| echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" | |
| else | |
| VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*= *"\(.*\)"/\1/') | |
| echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create and push tag | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| git tag "${{ steps.version.outputs.tag }}" | |
| git push origin "${{ steps.version.outputs.tag }}" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libxcb1-dev \ | |
| libxcb-render0-dev \ | |
| libxcb-shape0-dev \ | |
| libxcb-xfixes0-dev \ | |
| libssl-dev \ | |
| pkg-config \ | |
| fuse | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: ${{ runner.os }}-cargo- | |
| - name: Build release binary | |
| run: cargo build --release | |
| - name: Download appimagetool | |
| run: | | |
| 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 | |
| - name: Create AppDir | |
| run: | | |
| mkdir -p AppDir/usr/bin | |
| cp target/release/sheesh-rs AppDir/usr/bin/sheesh-rs | |
| # Desktop entry | |
| cat > AppDir/sheesh-rs.desktop <<'EOF' | |
| [Desktop Entry] | |
| Name=Sheesh | |
| Exec=sheesh-rs | |
| Icon=sheesh-rs | |
| Type=Application | |
| Categories=Utility;TerminalEmulator; | |
| Terminal=true | |
| EOF | |
| # Icon | |
| cp logo.png AppDir/sheesh-rs.png | |
| # AppRun | |
| cat > AppDir/AppRun <<'EOF' | |
| #!/bin/sh | |
| exec "$APPDIR/usr/bin/sheesh-rs" "$@" | |
| EOF | |
| chmod +x AppDir/AppRun | |
| - name: Build AppImage | |
| env: | |
| ARCH: x86_64 | |
| run: | | |
| appimagetool --appimage-extract-and-run AppDir sheesh-rs-${{ steps.version.outputs.tag }}-x86_64.AppImage | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.version.outputs.tag }} | |
| files: sheesh-rs-${{ steps.version.outputs.tag }}-x86_64.AppImage | |
| generate_release_notes: true |