Skip to content

Release memex version 0.10.1 #40

Release memex version 0.10.1

Release memex version 0.10.1 #40

Workflow file for this run

name: release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build-macos:
runs-on: macos-15
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-apple-darwin
arch: x86_64
- target: aarch64-apple-darwin
arch: arm64
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
arch="${{ matrix.arch }}"
artifact="memex-${version}-macos-${arch}.tar.gz"
tar -C target/${{ matrix.target }}/release -czf "${artifact}" memex
shasum -a 256 "${artifact}" > "${artifact}.sha256"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: memex-macos-${{ matrix.arch }}
path: |
memex-*.tar.gz
memex-*.sha256
build-linux:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
arch: x86_64
runner: ubuntu-latest
- target: aarch64-unknown-linux-gnu
arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
arch="${{ matrix.arch }}"
artifact="memex-${version}-linux-${arch}.tar.gz"
tar -C target/${{ matrix.target }}/release -czf "${artifact}" memex
sha256sum "${artifact}" > "${artifact}.sha256"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: memex-linux-${{ matrix.arch }}
path: |
memex-*.tar.gz
memex-*.sha256
release:
needs: [build-macos, build-linux]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- name: Upload release assets
uses: softprops/action-gh-release@v3
with:
files: artifacts/*
update-homebrew:
needs: release
runs-on: ubuntu-latest
steps:
- name: Trigger homebrew-tap update
run: |
# Strip all leading v's to handle vv0.2.3 -> 0.2.3
VERSION="${GITHUB_REF_NAME#v}"
VERSION="${VERSION#v}"
curl -X POST \
-H "Authorization: token ${{ secrets.HOMEBREW_TAP_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/nicosuave/homebrew-tap/dispatches \
-d "{\"event_type\":\"update-formula\",\"client_payload\":{\"formula\":\"memex\",\"version\":\"${VERSION}\",\"repo\":\"nicosuave/memex\"}}"