rust: packaging (Linux desktop entry, macOS bundle), cargo release script with update manifests, CI
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["**"]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test (${{ matrix.os }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-22.04, macos-14, windows-latest]
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: rust
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Linux dependencies (GUI libs, and sshd for the SSH integration tests)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libxkbcommon-dev libgl1-mesa-dev libx11-dev libxcursor-dev libxrandr-dev libxi-dev libwayland-dev libgtk-3-dev openssh-server
|
||||
- run: cargo test --locked --workspace
|
||||
- run: cargo clippy --locked --workspace -- -D warnings
|
||||
@@ -17,118 +17,50 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- platform: darwin/amd64
|
||||
runner: macos-13
|
||||
os: darwin
|
||||
arch: amd64
|
||||
archive_type: zip
|
||||
- platform: darwin/arm64
|
||||
runner: macos-14
|
||||
os: darwin
|
||||
arch: arm64
|
||||
archive_type: zip
|
||||
- platform: linux/amd64
|
||||
runner: ubuntu-latest
|
||||
os: linux
|
||||
arch: amd64
|
||||
archive_type: tar
|
||||
- platform: linux/arm64
|
||||
runner: ubuntu-24.04-arm64
|
||||
os: linux
|
||||
arch: arm64
|
||||
archive_type: tar
|
||||
- platform: windows/amd64
|
||||
runner: windows-latest
|
||||
os: windows
|
||||
arch: amd64
|
||||
archive_type: zip
|
||||
- platform: windows/arm64
|
||||
runner: ubuntu-latest
|
||||
os: windows
|
||||
arch: arm64
|
||||
archive_type: zip
|
||||
cross: true
|
||||
|
||||
- { platform: darwin/amd64, runner: macos-13 }
|
||||
- { platform: darwin/arm64, runner: macos-14 }
|
||||
- { platform: linux/amd64, runner: ubuntu-22.04 }
|
||||
- { platform: linux/arm64, runner: ubuntu-22.04-arm }
|
||||
- { platform: windows/amd64, runner: windows-latest }
|
||||
- { platform: windows/arm64, runner: windows-11-arm }
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: rust
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
- name: Rust toolchain (pinned by rust-toolchain.toml)
|
||||
run: rustup show active-toolchain || rustup toolchain install
|
||||
|
||||
- name: Install Wails
|
||||
run: go install github.com/wailsapp/wails/v2/cmd/wails@$(go list -m -f '{{.Version}}' github.com/wailsapp/wails/v2)
|
||||
|
||||
- name: Install frontend dependencies
|
||||
run: npm ci
|
||||
working-directory: frontend
|
||||
|
||||
- name: Install Linux build dependencies
|
||||
if: matrix.os == 'linux'
|
||||
- name: Linux build dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev
|
||||
sudo apt-get install -y libxkbcommon-dev libgl1-mesa-dev libx11-dev libxcursor-dev libxrandr-dev libxi-dev libwayland-dev libgtk-3-dev zip
|
||||
|
||||
- name: Install Windows packaging tools
|
||||
if: matrix.os == 'windows' && matrix.cross
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y zip
|
||||
- name: Test
|
||||
run: cargo test --locked --workspace
|
||||
|
||||
- name: Build (non-Windows runners)
|
||||
if: matrix.runner != 'windows-latest'
|
||||
- name: Build and package
|
||||
env:
|
||||
CGO_ENABLED: "0"
|
||||
run: |
|
||||
wails build -platform "${{ matrix.platform }}" -ldflags "-s -w"
|
||||
NEXUS_RELEASE_TARGETS: ${{ matrix.platform }}
|
||||
NEXUS_RELEASE_ROOT: ${{ github.workspace }}/build/releases
|
||||
run: ./release.sh
|
||||
|
||||
- name: Build (Windows runner)
|
||||
if: matrix.runner == 'windows-latest'
|
||||
shell: pwsh
|
||||
env:
|
||||
CGO_ENABLED: "0"
|
||||
run: |
|
||||
wails build -platform "${{ matrix.platform }}" -ldflags "-s -w"
|
||||
|
||||
- name: Package (zip)
|
||||
if: matrix.archive_type == 'zip' && matrix.runner != 'windows-latest'
|
||||
run: |
|
||||
archive="alchementary-link-${{ matrix.platform }}.zip"
|
||||
cd build/bin
|
||||
zip -r "../../${archive}" .
|
||||
|
||||
- name: Package (tar)
|
||||
if: matrix.archive_type == 'tar'
|
||||
run: |
|
||||
archive="alchementary-link-${{ matrix.platform }}.tar.gz"
|
||||
tar -czf "${archive}" -C build/bin .
|
||||
|
||||
- name: Package (Windows zip)
|
||||
if: matrix.archive_type == 'zip' && matrix.runner == 'windows-latest'
|
||||
shell: pwsh
|
||||
run: |
|
||||
$archive = "alchementary-link-${{ matrix.platform }}.zip"
|
||||
Compress-Archive -Path "build/bin/*" -DestinationPath $archive
|
||||
|
||||
- name: Upload artifact
|
||||
- name: Upload artefacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: alchementary-link-${{ matrix.platform }}
|
||||
name: nexus-terminal-${{ matrix.runner }}
|
||||
path: |
|
||||
alchementary-link-${{ matrix.platform }}.zip
|
||||
alchementary-link-${{ matrix.platform }}.tar.gz
|
||||
build/releases/*/NexusTerminal-*.zip
|
||||
build/releases/manifest-*.json
|
||||
build/releases/version-*.txt
|
||||
|
||||
- name: Attach to GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
alchementary-link-${{ matrix.platform }}.zip
|
||||
alchementary-link-${{ matrix.platform }}.tar.gz
|
||||
files: build/releases/*/NexusTerminal-*.zip
|
||||
|
||||
Reference in New Issue
Block a user