Skip to content

Commit

Permalink
add release ci;add bin config to satisfy cargo-binstall
Browse files Browse the repository at this point in the history
  • Loading branch information
CNCSMonster committed Sep 26, 2024
1 parent 9e1e16c commit 5b4521b
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

env:
CARGO_TERM_COLOR: always

jobs:
release:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: tar.gz

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}

- name: Cache Dependencies
uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Pack Artifacts
env:
RELEASE_NAME: xdotter-${{ matrix.target }}
ARTIFACTS_DIR: target/${{ matrix.target }}/release
run: |
mkdir $RELEASE_NAME
cp $ARTIFACTS_DIR/xdotter -t $RELEASE_NAME
cp readme.md LICENSE -t $RELEASE_NAME
tar -zcvf $RELEASE_NAME.${{ matrix.archive }} -C $RELEASE_NAME .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: xdotter-${{ matrix.target }}.${{ matrix.archive }}
2 changes: 1 addition & 1 deletion Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[package]
name = "xdotter"
version = "0.0.7"
version = "0.0.8"
edition = "2021"
authors = ["cncsmonster <[email protected]>"]
description = "A simple dotfile manager"
license = "MIT"
repository = "https://github.com/cncsmonster/xdotter"

[[bin]]
name = "xdotter"
path = "src/main.rs"

[dependencies]
anyhow = "1.0.86"
Expand Down

0 comments on commit 5b4521b

Please sign in to comment.