From 1e8f4aacf56f7496334aeb88ad80573e7914f3cc Mon Sep 17 00:00:00 2001 From: leon332157 Date: Sat, 11 Sep 2021 18:43:06 -0400 Subject: [PATCH] Fix snap package depdencencies (#909) * change the confinement * fix Cargo.toml * fix snap package * new name Co-authored-by: AnhQuan Nguyen --- .github/workflows/build.yml | 418 +++++++++++++++++----------------- .github/workflows/release.yml | 32 +++ .github/workflows/snap.yaml | 32 +-- snap/snapcraft.yaml | 8 +- 4 files changed, 261 insertions(+), 229 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8941a2..87de899 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,232 +4,228 @@ on: [push] jobs: build-windows: - runs-on: windows-latest steps: - - uses: actions/checkout@v2 - - - name: Install Nightly Toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: rustfmt - override: true - - - name: Install Utilities - run: | - cargo install cargo2junit - - - uses: Swatinem/rust-cache@v1 - - - name: Check Formatting - run: | - cargo fmt --all -- --check - - - name: Install Neovim - run: | - choco install -y neovim - - - name: Test - env: - NEOVIM_BIN: "C:/tools/neovim/Neovim/bin/nvim.exe" - RUST_BACKTRACE: full - run: | - cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml - - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v1 - if: always() - with: - files: results.xml - - - name: Build Release - run: | - cargo build --release - - - name: Archive Windows artifact - run: | - powershell rm ./target/release/neovide.zip - powershell Compress-Archive ./target/release/neovide.exe ./target/release/neovide.zip - - - uses: actions/upload-artifact@v1 - with: - name: neovide-windows.zip - path: ./target/release/neovide.zip + - uses: actions/checkout@v2 + + - name: Install Nightly Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + override: true + + - name: Install Utilities + run: | + cargo install cargo2junit + + - uses: Swatinem/rust-cache@v1 + + - name: Check Formatting + run: | + cargo fmt --all -- --check + + - name: Install Neovim + run: | + choco install -y neovim + + - name: Test + env: + NEOVIM_BIN: "C:/tools/neovim/Neovim/bin/nvim.exe" + RUST_BACKTRACE: full + run: | + cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v1 + if: always() + with: + files: results.xml + + - name: Build Release + run: | + cargo build --release + + - name: Archive Windows artifact + run: | + powershell rm ./target/release/neovide.zip + powershell Compress-Archive ./target/release/neovide.exe ./target/release/neovide.zip + + - uses: actions/upload-artifact@v1 + with: + name: neovide-windows.zip + path: ./target/release/neovide.zip build-mac: - runs-on: macos-latest steps: - - uses: actions/checkout@v2 - - - name: Install Nightly Toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: rustfmt - override: true - - - name: Install Utilities - run: | - cargo install cargo2junit - - - uses: Swatinem/rust-cache@v1 - - - name: Check Formatting - run: | - cargo fmt --all -- --check - - - name: Uninstall Conflicting LLVM - run: | - brew uninstall llvm - - - name: Install Neovim - run: | - brew install neovim - - - name: Test - env: - RUST_BACKTRACE: full - run: | - cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml - - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v1 - if: always() - with: - files: results.xml - - - name: Build Release - run: | - cargo build --release - cargo install cargo-bundle - cargo bundle --release - - - name: Create .dmg file - run: | - hdiutil create Neovide-uncompressed.dmg -volname "Neovide" -srcfolder target/release/bundle/osx - hdiutil convert Neovide-uncompressed.dmg -format UDZO -o Neovide.dmg - - - uses: actions/upload-artifact@v1 - with: - name: Neovide.dmg - path: ./Neovide.dmg + - uses: actions/checkout@v2 + + - name: Install Nightly Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + override: true + + - name: Install Utilities + run: | + cargo install cargo2junit + + - uses: Swatinem/rust-cache@v1 + + - name: Check Formatting + run: | + cargo fmt --all -- --check + + - name: Uninstall Conflicting LLVM + run: | + brew uninstall llvm + + - name: Install Neovim + run: | + brew install neovim + + - name: Test + env: + RUST_BACKTRACE: full + run: | + cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v1 + if: always() + with: + files: results.xml + + - name: Build Release + run: | + cargo build --release + cargo install cargo-bundle + cargo bundle --release + + - name: Create .dmg file + run: | + hdiutil create Neovide-uncompressed.dmg -volname "Neovide" -srcfolder target/release/bundle/osx + hdiutil convert Neovide-uncompressed.dmg -format UDZO -o Neovide.dmg + + - uses: actions/upload-artifact@v1 + with: + name: Neovide.dmg + path: ./Neovide.dmg build-linux: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Install Nightly Toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: rustfmt - override: true - - - name: Install Utilities - run: | - cargo install cargo2junit - - - uses: Swatinem/rust-cache@v1 - - - name: Install Dependencies - run: | - sudo apt-get install -y curl gnupg ca-certificates git gcc-multilib g++-multilib cmake libssl-dev pkg-config libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev libbz2-dev freeglut3-dev libxi-dev - - - name: Check Formatting - run: | - cargo fmt --all -- --check - - - name: Install Neovim - run: | - sudo apt-get install -y neovim - - - name: Test - env: - RUST_BACKTRACE: full - run: | - cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml - - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action@v1 - if: always() - with: - files: results.xml - - - name: Build Release - run: | - cargo build --release - - - name: Archive Linux artifact - run: | - tar czvf ./target/release/neovide.tar.gz ./target/release/neovide - - - uses: actions/upload-artifact@v1 - with: - name: neovide-linux.tar.gz - path: ./target/release/neovide.tar.gz + - uses: actions/checkout@v2 + + - name: Install Nightly Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + override: true + + - name: Install Utilities + run: | + cargo install cargo2junit + + - uses: Swatinem/rust-cache@v1 + + - name: Install Dependencies + run: | + sudo apt-get install -y curl gnupg ca-certificates git gcc-multilib g++-multilib cmake libssl-dev pkg-config libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev libbz2-dev freeglut3-dev libxi-dev + + - name: Check Formatting + run: | + cargo fmt --all -- --check + + - name: Install Neovim + run: | + sudo apt-get install -y neovim + + - name: Test + env: + RUST_BACKTRACE: full + run: | + cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v1 + if: always() + with: + files: results.xml + + - name: Build Release + run: | + cargo build --release + + - name: Archive Linux artifact + run: | + tar czvf ./target/release/neovide.tar.gz ./target/release/neovide + + - uses: actions/upload-artifact@v1 + with: + name: neovide-linux.tar.gz + path: ./target/release/neovide.tar.gz build-m1: - runs-on: self-hosted steps: - - uses: actions/checkout@v2 - - - name: Install Nightly Toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: rustfmt - override: true - - - name: Install Utilities - run: | - cargo install cargo2junit - - - name: Check Formatting - run: | - cargo fmt --all -- --check - - - name: Install Neovim - run: | - arch -arm64 brew install neovim - - - name: Test - env: - RUST_BACKTRACE: full - run: | - cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml - - - name: Publish Test Results - uses: EnricoMi/publish-unit-test-result-action/composite@v1 - if: always() - continue-on-error: true - with: - files: results.xml - - - name: Build Release - run: | - cargo build --release - cargo install cargo-bundle - cargo bundle --release - - - name: Create .dmg file - run: | - hdiutil create Neovide-uncompressed.dmg -volname "Neovide" -srcfolder target/release/bundle/osx - hdiutil convert Neovide-uncompressed.dmg -format UDZO -o Neovide.dmg - - - uses: actions/upload-artifact@v1 - with: - name: Neovide-m1.dmg - path: ./Neovide.dmg + - uses: actions/checkout@v2 + + - name: Install Nightly Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + override: true + + - name: Install Utilities + run: | + cargo install cargo2junit + + - name: Check Formatting + run: | + cargo fmt --all -- --check + + - name: Install Neovim + run: | + arch -arm64 brew install neovim + + - name: Test + env: + RUST_BACKTRACE: full + run: | + cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action/composite@v1 + if: always() + continue-on-error: true + with: + files: results.xml + + - name: Build Release + run: | + cargo build --release + cargo install cargo-bundle + cargo bundle --release + + - name: Create .dmg file + run: | + hdiutil create Neovide-uncompressed.dmg -volname "Neovide" -srcfolder target/release/bundle/osx + hdiutil convert Neovide-uncompressed.dmg -format UDZO -o Neovide.dmg + + - uses: actions/upload-artifact@v1 + with: + name: Neovide-m1.dmg + path: ./Neovide.dmg diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ced5515 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Releases + +on: + workflow_dispatch: + inputs: + logLevel: + description: "Log level" + required: true + default: "warning" + +jobs: + snap: + runs-on: ubuntu-20.04 + + steps: + - name: Check out Git repository + uses: actions/checkout@v2 + + - uses: snapcore/action-build@v1 + env: + SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY: 6G + id: snapcraft + + - uses: actions/upload-artifact@v2 + with: + name: snap + path: ${{ steps.snapcraft.outputs.snap }} + + - uses: snapcore/action-publish@v1 + with: + store_login: ${{ secrets.SNAPCRAFT_TOKEN }} + snap: ${{ steps.snapcraft.outputs.snap }} diff --git a/.github/workflows/snap.yaml b/.github/workflows/snap.yaml index e819d99..a98cf2c 100644 --- a/.github/workflows/snap.yaml +++ b/.github/workflows/snap.yaml @@ -2,27 +2,27 @@ name: Snap on: push: - branches: [ main ] + branches: [main] jobs: snap: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - - name: Check out Git repository - uses: actions/checkout@v2 + - name: Check out Git repository + uses: actions/checkout@v2 - - uses: snapcore/action-build@v1 - env: - SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY: 6G - id: snapcraft + - uses: snapcore/action-build@v1 + env: + SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY: 6G + id: snapcraft - - uses: actions/upload-artifact@v2 - with: - name: snap - path: ${{ steps.snapcraft.outputs.snap }} + - uses: actions/upload-artifact@v2 + with: + name: snap + path: ${{ steps.snapcraft.outputs.snap }} - - uses: snapcore/action-publish@v1 - with: - store_login: ${{ secrets.SNAPCRAFT_TOKEN }} - snap: ${{ steps.snapcraft.outputs.snap }} + - uses: snapcore/action-publish@v1 + with: + store_login: ${{ secrets.SNAPCRAFT_EDGE_TOKEN }} + snap: ${{ steps.snapcraft.outputs.snap }} diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index f3e7999..8e53780 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: neovide # you probably want to 'snapcraft register ' -base: core18 # the base snap is the execution environment for this snap +base: core20 # the base snap is the execution environment for this snap version: "0.8.0+git" summary: The snappiest vim editor you are likely to find. description: | @@ -7,7 +7,7 @@ description: | but it should act functionally like the terminal UI. grade: stable # must be 'stable' to release into candidate/stable channels -confinement: classic # use 'strict' once you have the right plugs and slots +confinement: strict # use 'strict' once you have the right plugs and slots build-packages: - cmake - freeglut3-dev @@ -91,6 +91,10 @@ parts: - libfontconfig1-dev - libfreetype6-dev stage-packages: + - libxkbcommon0 + - libxkbcommon-x11-0 + - libegl1-mesa-dev + - libgl1-mesa-dev - fontconfig - fonts-noto - libfontconfig1