Skip to content

Commit

Permalink
feat: restore release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Oct 18, 2024
1 parent b0cbf03 commit 4a2fe28
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 107 deletions.
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]

[target.aarch64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]
31 changes: 0 additions & 31 deletions .github/workflows/luarocks.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/release-please.yaml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
include:
# Linux builds (statically linked for compatibility, have to use glibc for FFI)
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: target/x86_64-unknown-linux-gnu/release/libblink_cmp_fuzzy.so
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
artifact_name: target/aarch64-unknown-linux-gnu/release/libblink_cmp_fuzzy.so

# macOS builds
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: target/x86_64-apple-darwin/release/libblink_cmp_fuzzy.dylib
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: target/aarch64-apple-darwin/release/libblink_cmp_fuzzy.dylib

# Windows builds
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: target/x86_64-pc-windows-msvc/release/blink_cmp_fuzzy.dll

steps:
- uses: actions/checkout@v4

- name: Install Rust
run: |
rustup toolchain install nightly
rustup default nightly
rustup target add ${{ matrix.target }}
- name: Build for Linux
if: contains(matrix.os, 'ubuntu')
run: |
cargo install cross --git https://github.com/cross-rs/cross
RUSTFLAGS="-C target-feature=-crt-static" cross build --release --target ${{ matrix.target }}
mv "${{ matrix.artifact_name }}" "${{ matrix.target }}.so"
- name: Build for macOS
if: contains(matrix.os, 'macos')
run: |
# Ventura
MACOSX_DEPLOYMENT_TARGET="13" cargo build --release --target ${{ matrix.target }}
mv "${{ matrix.artifact_name }}" "${{ matrix.target }}.dylib"
- name: Build for Windows
if: contains(matrix.os, 'windows')
run: |
cargo build --release --target ${{ matrix.target }}
mv "${{ matrix.artifact_name }}" "${{ matrix.target }}.dll"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: ${{ matrix.target }}.*

release:
name: Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
token: ${{ github.token }}
files: ./**/*
draft: false
prerelease: false
generate_release_notes: true
52 changes: 0 additions & 52 deletions .github/workflows/template.rockspec

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
version = 'v0.*',
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- On musl libc based systems you need to add this flag
-- build = 'RUSTFLAGS="-C target-feature=-crt-static" cargo build --release',

opts = {
highlight = {
Expand Down

0 comments on commit 4a2fe28

Please sign in to comment.