Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Check if package is publishable
run: cargo publish --dry-run
run: cargo publish --dry-run --locked

- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}

run: cargo publish --locked --token ${{ secrets.CRATES_IO_TOKEN }}

62 changes: 62 additions & 0 deletions .github/workflows/release-on-version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release on Version Bump

on:
push:
branches:
- main
paths:
- 'Cargo.toml'

permissions:
contents: write

jobs:
detect-version-change:
name: Detect version change
runs-on: ubuntu-latest
outputs:
changed: ${{ steps.detect.outputs.changed }}
version: ${{ steps.detect.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect version bump
id: detect
shell: bash
run: |
set -euo pipefail
CURRENT_VERSION=$(grep '^version\s*=\s*"' Cargo.toml | head -n1 | cut -d '"' -f 2)
echo "Current: $CURRENT_VERSION"

if git rev-parse HEAD~1 >/dev/null 2>&1; then
PREV_VERSION=$(git show HEAD~1:Cargo.toml | grep '^version\s*=\s*"' | head -n1 | cut -d '"' -f 2 || true)
else
PREV_VERSION=""
fi
echo "Previous: ${PREV_VERSION:-<none>}"

if [ "$CURRENT_VERSION" != "$PREV_VERSION" ] && [ -n "$CURRENT_VERSION" ]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

create-release:
name: Create GitHub release
needs: detect-version-change
if: needs.detect-version-change.outputs.changed == 'true'
runs-on: ubuntu-latest
steps:
- name: Create/Update release v${{ needs.detect-version-change.outputs.version }}
uses: ncipollo/release-action@v1
with:
tag: v${{ needs.detect-version-change.outputs.version }}
name: v${{ needs.detect-version-change.outputs.version }}
generateReleaseNotes: true
draft: false
prerelease: false

26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: Release
name: Release Assets

on:
release:
types: [published]

permissions:
contents: write

jobs:
build-and-upload:
name: Build for ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
name: Build for ${{ matrix.runner }} ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
arch: x86_64
- os: macos-latest
- runner: macos-latest
target: aarch64-apple-darwin
arch: arm64
- runner: macos-12
target: x86_64-apple-darwin
arch: x86_64
fail-fast: false

steps:
- name: Checkout code
Expand All @@ -33,7 +37,7 @@ jobs:
- name: Build tarts
run: cargo build --release --target ${{ matrix.target }}

- name: Create archive
- name: Create archive and checksum
shell: bash
run: |
# Standard naming convention for Homebrew: tarts-{version}-{target}.tar.gz
Expand All @@ -42,10 +46,14 @@ jobs:
cp target/${{ matrix.target }}/release/tarts dist/tarts
tar -czvf "$ASSET_NAME" -C dist tarts
echo "ASSET_NAME=$ASSET_NAME" >> $GITHUB_ENV
# Generate sha256 checksum file alongside the archive
shasum -a 256 "$ASSET_NAME" | awk '{print $1}' > "$ASSET_NAME.sha256"

- name: Upload release asset
uses: softprops/action-gh-release@v1
with:
files: ${{ env.ASSET_NAME }}
files: |
${{ env.ASSET_NAME }}
${{ env.ASSET_NAME }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 9 additions & 5 deletions .tmuxp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@ windows:
panes:
- shell_command:
- helix
- window_name: cmd
- window_name: agent
start-directory: ./
panes:
- shell_command:
- clear
- window_name: srv
- window_name: cmd1
start-directory: ./
panes:
- shell_command:
- clear
- window_name: notes
- eza --long
- window_name: cmd2
panes:
- shell_command:
- eza --long
- window_name: files
panes:
- shell_command:
- emacs -nw notes.org
- yazi
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tarts" # shortcut from Terminal Arts
version = "0.1.20"
version = "0.1.21"
edition = "2024"

authors = ["oiwn <alex@imscraping.ninja>"]
Expand Down