This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: CD | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
publish: | ||
name: Publishing ${{ matrix.build_target }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
build_target: [linux] | ||
include: | ||
- build_target: linux | ||
os: ubuntu-latest | ||
artifact_suffix: linux-x86_64 | ||
target: x86_64-unknown-linux-musl | ||
features: '' | ||
steps: | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
target: ${{ matrix.target }} | ||
profile: minimal | ||
- name: Install Linux dependencies | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt update | ||
sudo apt install libncursesw5 | ||
- uses: actions/checkout@v2 | ||
name: Checkout src | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Running cargo build | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
- name: Extract git tag | ||
shell: bash | ||
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})" | ||
id: extract_tag | ||
- name: Packaging assets | ||
shell: bash | ||
run: | | ||
cd target/ | ||
ls -la | ||
cd release | ||
ls -la | ||
tar czvf ircgrep-${{ matrix.target }}.tar.gz ircgrep* | ||
shasum -a 256 ircgrep-${{ matrix.target }}.tar.gz > ircgrep-${{ matrix.target }}.sha256 | ||
- name: Releasing assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: target/release/ircgrep-* | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |