|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: ["v*"] |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +env: |
| 12 | + CARGO_TERM_COLOR: always |
| 13 | + CARGO_INCREMENTAL: "0" |
| 14 | + |
| 15 | +jobs: |
| 16 | + linux: |
| 17 | + name: Linux · AppImage + tarball |
| 18 | + runs-on: ubuntu-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Install slint build dependencies |
| 23 | + run: | |
| 24 | + sudo apt-get update |
| 25 | + sudo apt-get install -y \ |
| 26 | + libxkbcommon-dev libwayland-dev wayland-protocols \ |
| 27 | + libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ |
| 28 | + libfontconfig1-dev libgl1-mesa-dev |
| 29 | +
|
| 30 | + - name: Install Rust toolchain |
| 31 | + uses: dtolnay/rust-toolchain@stable |
| 32 | + |
| 33 | + - uses: Swatinem/rust-cache@v2 |
| 34 | + |
| 35 | + - name: Build release |
| 36 | + run: cargo build --release --locked |
| 37 | + |
| 38 | + - name: Tarball (raw binary) |
| 39 | + run: | |
| 40 | + mkdir -p dist |
| 41 | + install -Dm755 target/release/acag stage/acag |
| 42 | + install -Dm644 README.md stage/README.md |
| 43 | + install -Dm644 LICENSE stage/LICENSE |
| 44 | + tar -C stage -czf "dist/acag-${VERSION}-linux-x86_64.tar.gz" . |
| 45 | + env: |
| 46 | + VERSION: ${{ github.ref_name }} |
| 47 | + |
| 48 | + - name: Build AppImage |
| 49 | + run: | |
| 50 | + curl -fsSL -o linuxdeploy.AppImage \ |
| 51 | + https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage |
| 52 | + chmod +x linuxdeploy.AppImage |
| 53 | +
|
| 54 | + # AppImage's own runtime needs FUSE; extract-and-run avoids it on CI. |
| 55 | + export APPIMAGE_EXTRACT_AND_RUN=1 |
| 56 | +
|
| 57 | + # Icon basename must match Icon= in the .desktop file. |
| 58 | + cp assets/icons/icon-256.png article-cover-art-generator.png |
| 59 | +
|
| 60 | + export OUTPUT="acag-${VERSION}-x86_64.AppImage" |
| 61 | + ./linuxdeploy.AppImage \ |
| 62 | + --appdir AppDir \ |
| 63 | + -e target/release/acag \ |
| 64 | + -d assets/article-cover-art-generator.desktop \ |
| 65 | + -i article-cover-art-generator.png \ |
| 66 | + --output appimage |
| 67 | +
|
| 68 | + mv "${OUTPUT}" dist/ |
| 69 | + env: |
| 70 | + VERSION: ${{ github.ref_name }} |
| 71 | + |
| 72 | + - name: Publish to release |
| 73 | + uses: softprops/action-gh-release@v2 |
| 74 | + with: |
| 75 | + files: dist/* |
| 76 | + |
| 77 | + windows: |
| 78 | + name: Windows · standalone .exe |
| 79 | + runs-on: windows-latest |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v4 |
| 82 | + |
| 83 | + - name: Install Rust toolchain |
| 84 | + uses: dtolnay/rust-toolchain@stable |
| 85 | + |
| 86 | + - uses: Swatinem/rust-cache@v2 |
| 87 | + |
| 88 | + - name: Build release (static CRT) |
| 89 | + run: cargo build --release --locked |
| 90 | + env: |
| 91 | + # Statically link the MSVC runtime so the .exe runs without vcredist. |
| 92 | + RUSTFLAGS: "-C target-feature=+crt-static" |
| 93 | + |
| 94 | + - name: Zip |
| 95 | + shell: pwsh |
| 96 | + run: | |
| 97 | + New-Item -ItemType Directory -Force -Path dist, stage | Out-Null |
| 98 | + Copy-Item target/release/acag.exe stage/ |
| 99 | + Copy-Item README.md stage/ |
| 100 | + Copy-Item LICENSE stage/ |
| 101 | + Compress-Archive -Path stage/* -DestinationPath "dist/acag-$env:VERSION-windows-x86_64.zip" |
| 102 | + env: |
| 103 | + VERSION: ${{ github.ref_name }} |
| 104 | + |
| 105 | + - name: Publish to release |
| 106 | + uses: softprops/action-gh-release@v2 |
| 107 | + with: |
| 108 | + files: dist/* |
0 commit comments