Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d16a867640 | |||
| 616050075f | |||
| e22afe9621 | |||
| bdfac71e65 | |||
| a00bb37478 | |||
| d30a4efd9b | |||
| 6baf2e64ca | |||
| c0a71a2d49 | |||
| a609c1af95 | |||
| 3d32be8a83 | |||
| c4c71dc892 | |||
| 4e625afaba | |||
| 9578f991f4 | |||
| 1cd7916e06 |
@@ -8,13 +8,17 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: rust:latest
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: src
|
working-directory: src
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
run: |
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -3,18 +3,33 @@ name: Release
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- "v*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux-static:
|
build-linux-static:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: rust:latest
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: src
|
working-directory: src
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Rust + zigbuild
|
||||||
|
run: |
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
||||||
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||||
|
sudo apt-get update -qq && sudo apt-get install -y -qq jq
|
||||||
|
pip install ziglang --quiet --break-system-packages
|
||||||
|
$HOME/.cargo/bin/cargo install cargo-zigbuild
|
||||||
|
$HOME/.cargo/bin/rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
- name: Create musl C/C++ wrappers
|
||||||
|
run: |
|
||||||
|
ZIG=$(python3 -c "import ziglang, os; print(os.path.join(os.path.dirname(ziglang.__file__), 'zig'))")
|
||||||
|
printf '#!/bin/sh\nexec "%s" cc -target x86_64-linux-musl "$@"\n' "$ZIG" | sudo tee /usr/local/bin/x86_64-linux-musl-gcc > /dev/null
|
||||||
|
printf '#!/bin/sh\nexec "%s" c++ -target x86_64-linux-musl "$@"\n' "$ZIG" | sudo tee /usr/local/bin/x86_64-linux-musl-g++ > /dev/null
|
||||||
|
sudo chmod +x /usr/local/bin/x86_64-linux-musl-gcc /usr/local/bin/x86_64-linux-musl-g++
|
||||||
|
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -25,13 +40,8 @@ jobs:
|
|||||||
key: linux-musl-cargo-${{ hashFiles('src/Cargo.lock') }}
|
key: linux-musl-cargo-${{ hashFiles('src/Cargo.lock') }}
|
||||||
restore-keys: linux-musl-cargo-
|
restore-keys: linux-musl-cargo-
|
||||||
|
|
||||||
- name: Install musl toolchain
|
|
||||||
run: |
|
|
||||||
apt-get update -qq && apt-get install -y -qq musl-tools
|
|
||||||
rustup target add x86_64-unknown-linux-musl
|
|
||||||
|
|
||||||
- name: Build static binary
|
- name: Build static binary
|
||||||
run: cargo build --release --target x86_64-unknown-linux-musl
|
run: cargo zigbuild --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
run: |
|
run: |
|
||||||
@@ -39,9 +49,17 @@ jobs:
|
|||||||
cp target/x86_64-unknown-linux-musl/release/obikmer /tmp/dist/obikmer-linux-x86_64
|
cp target/x86_64-unknown-linux-musl/release/obikmer /tmp/dist/obikmer-linux-x86_64
|
||||||
strip /tmp/dist/obikmer-linux-x86_64
|
strip /tmp/dist/obikmer-linux-x86_64
|
||||||
|
|
||||||
- name: Upload release asset
|
- name: Create Gitea release and upload binary
|
||||||
uses: actions/upload-artifact@v4
|
env:
|
||||||
with:
|
GITEA_TOKEN: ${{ secrets.GITEATOKEN }}
|
||||||
name: obikmer-linux-x86_64
|
TAG: ${{ github.ref_name }}
|
||||||
path: /tmp/dist/obikmer-linux-x86_64
|
run: |
|
||||||
if-no-files-found: error
|
release_id=$(curl -s -X POST \
|
||||||
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases" \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}" | jq -r '.id')
|
||||||
|
curl -s -X POST \
|
||||||
|
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/$release_id/assets" \
|
||||||
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-F "attachment=@/tmp/dist/obikmer-linux-x86_64"
|
||||||
|
|||||||
@@ -86,5 +86,9 @@ bump-version:
|
|||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: bump-version
|
release: bump-version
|
||||||
|
@new_version=$$(grep '^version = ' $(CARGO_TOML) | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \
|
||||||
|
git tag "v$$new_version"
|
||||||
@jj auto-describe
|
@jj auto-describe
|
||||||
@jj git push --change @
|
@jj git push --change @
|
||||||
|
@new_version=$$(grep '^version = ' $(CARGO_TOML) | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \
|
||||||
|
git push origin "v$$new_version"
|
||||||
|
|||||||
Generated
+1
-1
@@ -1704,7 +1704,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "obikmer"
|
name = "obikmer"
|
||||||
version = "0.1.1"
|
version = "1.1.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"csv",
|
"csv",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "obikmer"
|
name = "obikmer"
|
||||||
version = "0.1.1"
|
version = "1.1.11"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|||||||
Reference in New Issue
Block a user