From 299cabe3a459ef5e808c509dd90e51e8016ad7d7 Mon Sep 17 00:00:00 2001 From: Tim Oram Date: Mon, 3 Feb 2020 20:58:31 -0330 Subject: Create main.yml --- .github/workflows/pull-request.yml | 48 ----------------- .github/workflows/release.yml | 107 +++++++++++++++++++++++++++++++++++++ .travis.yml | 21 ++------ Cargo.toml | 5 +- 4 files changed, 111 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/pull-request.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml deleted file mode 100644 index 9e9b7d4..0000000 --- a/.github/workflows/pull-request.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Pull Request - -on: [pull_request] - -jobs: - linux: - runs-on: [ubuntu-latest] - steps: - - uses: actions/checkout@v1 - - name: Install dependencies - run: sudo apt-get install build-essential libncursesw5-dev pkg-config liblzma-dev - - name: Test - run: cargo test -- - - name: Build - run: cargo build --release - - name: Test Run - run: cargo run --release -- --version - - name: Lint - run: "./scripts/lint.bash" - - name: Format - run: "./scripts/format.bash" - macos: - name: MacOS - runs-on: [macos] - steps: - - uses: actions/checkout@v1 - # Install Rust until actions/virtual-environments#6 is resolved - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Test - run: cargo test -- - - name: Build - run: cargo build --release - - name: Test Run - run: cargo run --release -- --version - windows: - name: Windows Test - runs-on: [windows-latest] - steps: - - uses: actions/checkout@v1 - - name: Test - run: cargo test --target x86_64-pc-windows-msvc --release -- - - name: Build - run: cargo build --target x86_64-pc-windows-msvc --release - - name: Test Run - run: cargo run --target x86_64-pc-windows-msvc --release -- --version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..03406f4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,107 @@ +name: Release Packages + +on: + release: + types: [published] + +jobs: + build-ubuntu: + strategy: + matrix: + version: ['14.04', '16.04', '18.04', '19.10', '20.04'] + runs-on: ubuntu-latest + container: + image: 'docker://ubuntu:${{ matrix.version }}' + steps: + - name: "Get Tag Name" + id: ref + shell: bash + run: | + ref="${{ github.ref }}"; + ref="${ref//refs\/heads\//}"; + ref="${ref//refs\/tags\//}"; + ref="${ref//master/dev}"; + echo "$ref"; + echo "::set-output name=name::$ref" + - name: "Checkout project" + uses: actions/checkout@v2 + - name: "System Setup" + run: | + apt-get update; + apt-get --assume-yes -f install curl build-essential libncursesw5-dev pkg-config liblzma-dev; + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y; + $HOME/.cargo/bin/cargo install --force cargo-deb + - name: "Build Deb" + run: $HOME/.cargo/bin/cargo +stable deb --output "target/debian/git-interactive-rebase-tool-${{ steps.ref.outputs.name }}-ubuntu-${{ matrix.version }}_amd64.deb" + - name: "Upload Release" + uses: softprops/action-gh-release@v1 + with: + files: | + target/debian/*.deb + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-debian: + strategy: + matrix: + version: ['8', '9', '10', 'bullseye', 'sid'] + runs-on: ubuntu-latest + container: + image: 'docker://debian:${{ matrix.version }}-slim' + steps: + - name: "Get Tag Name" + id: ref + shell: bash + run: | + ref="${{ github.ref }}"; + ref="${ref//refs\/heads\//}"; + ref="${ref//refs\/tags\//}"; + ref="${ref//master/dev}"; + echo "$ref"; + echo "::set-output name=name::$ref" + - name: "Checkout project" + uses: actions/checkout@v2 + - name: "System Setup" + run: | + apt-get update; + apt-get --assume-yes -f install curl build-essential libncursesw5-dev pkg-config liblzma-dev; + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y; + $HOME/.cargo/bin/cargo install --force cargo-deb + - name: "Build Deb" + run: $HOME/.cargo/bin/cargo +stable deb --output "target/debian/git-interactive-rebase-tool-${{ steps.ref.outputs.name }}-debian-${{ matrix.version }}_amd64.deb" + - name: "Upload Release" + uses: softprops/action-gh-release@v1 + with: + files: | + target/debian/*.deb + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build-macos: + runs-on: [macos] + steps: + - name: "Checkout project" + uses: actions/checkout@v2 + - name: "Build" + run: "cargo build --release" + - name: "Rename" + run: "cp target/release/interactive-rebase-tool target/release/macos-interactive-rebase-tool" + - name: "Upload Release" + uses: softprops/action-gh-release@v1 + with: + files: target/release/macos-interactive-rebase-tool + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build-windows: + runs-on: [windows-latest] + steps: + - name: "Checkout project" + uses: actions/checkout@v2 + - name: "Build" + run: "cargo rustc --target x86_64-pc-windows-msvc --release --bin interactive-rebase-tool -- -C lto" + - name: "Upload Release" + uses: softprops/action-gh-release@v1 + with: + files: target\x86_64-pc-windows-msvc\release\interactive-rebase-tool.exe + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml index c4f3f3f..b8c909c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,8 +22,6 @@ before_script: script: echo "Skip" jobs: - allow_failures: - - rust: nightly include: - stage: build-linux rust: stable @@ -40,22 +38,7 @@ jobs: tags: true provider: releases skip_cleanup: true - - stage: build-deb - rust: stable - os: linux - if: tag IS present - before_script: cargo install --force cargo-deb - script: "./scripts/build-deb.bash" - deploy: - api_key: - secure: "Kw8h+UisU2k1VBFLc3MqeQMy1Rp0icIEgzSW/BuYYY+xg7p0vQiip2btD6pV5zzVAcL6BrnHiEIksY1M5lc/pKyoy4uYyPFHE6Mfwofcf/3MUpqTzBygd95saiCehQW0RBWzgoYtDbLgyUohywFVxLrckHVLXspwG+8CAvEL5YQNlBAkMQB0I+9j+8/WCSxAKA9hRqvdBRxzn9Fu9goxlYrSnSbQmkeCc3xTnK8o3xXuVwRkvsyKnlQHTQ8nTmbJe3K5FR02UFSDBMe8EYrXntszF3ZQibxrJHT6xutw1ZfIOPJCNOotMhLBnXEXEhPvbfBH3ejUM24VbHB8wmGl+OFQGqHLhr7nSyHK5ObbtSrsa9NHJQGIXPi5lIq3o0+Nq8ZzRc1GbFEi+9Uw0YsRjgL35ASdAOhdplNpOhYPK+MPqPoInbCs9NLPLkcfR7OQefk4WLUrAAVMro6Q6dewBN6u+8ebOuz7OHYgAHoP+Cm3z8SNafqRbwT+jeeYLPkR3T6TmriL4Og3tqnMBGULCwj0Ui/NqmKXU9UDkY8LTKDRoGk05sHxSRzfjchUfmwgn3xcSZAWGf2grskB2WLKRcvTeG+j4GUIoVVyDmF2qZ25wh/vBAwX1k4Y6wlvXdqcL3A94Vy4SXF9vY0y+NH5Nsfd3m0PksYRG4wc1bVKqQ8=" - file_glob: true - file: target/debian/git-interactive-rebase-tool*.deb - on: - condition: $TRAVIS_RUST_VERSION = stable - tags: true - provider: releases - skip_cleanup: true + - stage: build-macos rust: stable os: osx @@ -71,12 +54,14 @@ jobs: tags: true provider: releases skip_cleanup: true + - stage: debian-latest-push rust: stable os: linux if: branch = master && type != pull_request before_script: cargo install --force cargo-deb script: "OS=debian ./scripts/push-latest-release.bash &>/dev/null" + - stage: macos-latest-push rust: stable os: osx diff --git a/Cargo.toml b/Cargo.toml index a655bc3..967fe75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,12 +55,9 @@ default = [] nightly = [] [package.metadata.deb] -maintainer = "Tim Oram " -copyright = "Tim Oram " -license-file = ["LICENSE", "2"] +license-file = ["LICENSE"] extended-description = """\ Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses.""" -depends = "libncursesw5 (>= 6), libgcc1 (>= 1:6), libtinfo5 (>= 6), zlib1g (>= 1:1), libc6 (>= 2)" section = "utility" priority = "optional" assets = [ -- cgit v1.2.3