Skip to content

Commit

Permalink
add release script and fix release action
Browse files Browse the repository at this point in the history
Signed-off-by: Aaqa Ishtyaq <[email protected]>
  • Loading branch information
aaqaishtyaq committed Dec 31, 2021
1 parent d6f6f6a commit ef31ee2
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 45 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
Expand Down Expand Up @@ -58,6 +60,8 @@ jobs:
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
Expand All @@ -83,6 +87,8 @@ jobs:
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ jobs:
tar czvf ../../../${{ matrix.name }} iay
cd -
- name: Deploy | Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}
path: ${{ matrix.name }}

# Create GitHub release with Rust build targets
github_release:
name: Create GitHub Release
Expand Down
43 changes: 0 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ categories = ["command-line-utilities"]
description = """
iay! The minimalistic, blazing-fast, and extendable prompt for bash and zsh.
"""
include = ["src/**/*", "Cross.toml", "LICENSE", "README.md"]
include = ["src/**/*", "LICENSE", "README.md"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ansi_term = "0.11.0"
clap = "2.33.3"
git2 = "0.13.22"
git2 = { version = "0.13.25", default-features = false }
libc = "0.2.101"
tico = "2.0.0"
lazy_static = "1.4.0"
24 changes: 24 additions & 0 deletions scripts/release
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

set -e

if [ "$(git symbolic-ref --short HEAD)" != "trunk" ]; then
echo "Can only release from trunk!" >&2
exit 1
fi

RELEASE_LEVEL=$1

case "$RELEASE_LEVEL" in
minor|major|patch)
echo "Creating a $RELEASE_LEVEL release..."
;;
*)
echo "Release level should be minor/major/patch" >&2
exit 1
;;
esac

# uses cargo-release to generate releases
# https://github.com/crate-ci/cargo-release
cargo release --execute --sign --skip-publish --no-dev-version $RELEASE_LEVEL

0 comments on commit ef31ee2

Please sign in to comment.