Skip to content

🔖 Prepare version 0.5.2 #40

🔖 Prepare version 0.5.2

🔖 Prepare version 0.5.2 #40

Workflow file for this run

name: Prepare Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
# (optional) Path to changelog.
# changelog: CHANGELOG.md
# (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
needs: create-release
strategy:
matrix:
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
arch: aarch_64
target_os: linux
asset_dir: ./target/aarch64-unknown-linux-gnu/release/
asset_name: linux-arm64
- target: aarch64-apple-darwin
os: macos-latest
arch: x86_64
target_os: osx
asset_dir: ./target/aarch64-apple-darwin/release/
asset_name: darwin-arm64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
arch: x86_64
target_os: linux
asset_dir: ./target/x86_64-unknown-linux-gnu/release/
asset_name: linux-amd64
- target: x86_64-apple-darwin
os: macos-latest
arch: x86_64
target_os: osx
asset_dir: ./target/x86_64-apple-darwin/release/
asset_name: darwin-amd64
runs-on: ${{ matrix.os }}
steps:
- name: Extract version
id: version-extract
run: export TAG="${{ github.ref_name }}" && echo "VERSION=${TAG#*v}" >> "$GITHUB_OUTPUT"
- name: debug
run: echo ${{ steps.version-extract.outputs.VERSION }}
- uses: actions/checkout@v4
- name: Install dependencies
run: |
declare VERSION=25.2 && \
echo "📦 Installing version: ${VERSION}" && \
echo "📦 Installing for os/arch: ${{ matrix.target_os }}/${{ matrix.arch }}" && \
PROTOC_ZIP=protoc-${VERSION}-${{ matrix.target_os }}-${{ matrix.arch }}.zip && \
echo "🏷️ Will get the archive file: ${PROTOC_ZIP}" && \
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${VERSION}/${PROTOC_ZIP} && \
echo "🏗️ Installing in path" && \
sudo unzip -o ${PROTOC_ZIP} -d /usr/local bin/protoc && \
sudo chmod +x /usr/local/bin/protoc && \
sudo unzip -o ${PROTOC_ZIP} -d /usr/local 'include/*' && \
echo "🧹 Cleaning up" && \
rm -f ${PROTO_ZIP}
- name: Install Rust
run: rustup update stable
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
- name: cross build
run: cargo build --target ${{ matrix.target }} --release
env:
PROTOC: /usr/local/bin/protoc
- name: Create archive
run: tar -C ${{ matrix.asset_dir }} -czf ./${{ matrix.asset_name }}.tar.gz doggy
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.asset_name }}.tar.gz
asset_name: doggy-${{ steps.version-extract.outputs.VERSION }}-${{ matrix.asset_name }}.tar.gz
tag: ${{ github.ref }}
homebrew-releaser:
needs: upload-assets
runs-on: ubuntu-latest
name: homebrew-releaser
steps:
- name: Release my project to my Homebrew tap
uses: Justintime50/homebrew-releaser@v1
with:
homebrew_owner: pyaillet
homebrew_tap: homebrew-formulas
formula_folder: pyaillet
# The Personal Access Token (saved as a repo secret) that has `repo` permissions for the repo running the action AND Homebrew tap you want to release to.
# Required - string
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
commit_owner: pyaillet
commit_email: [email protected]
# Custom install command for your formula.
# Required - string
install: 'bin.install "doggy" => "doggy"'
# Custom test command for your formula so you can run `brew test`.
# Optional - string
test: 'assert_match("doggy", shell_output("doggy --version"))'
# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized):
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz'
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz
# Optional - booleans
target_darwin_amd64: true
target_darwin_arm64: true
target_linux_amd64: true
target_linux_arm64: true
# Update your homebrew tap's README with a table of all projects in the tap.
# This is done by pulling the information from all your formula.rb files - eg:
#
# | Project | Description | Install |
# | ------------------------------------------ | ------------ | ------------------------ |
# | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` |
# | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` |
# | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` |
#
# Place the following in your README or wrap your project's table in these comment tags:
# <!-- project_table_start -->
# TABLE HERE
# <!-- project_table_end -->
#
# Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you.
# Default is `false` - boolean
update_readme_table: true
# Skips committing the generated formula to a homebrew tap (useful for local testing).
# Default is shown - boolean
skip_commit: false
# Logs debugging info to console.
# Default is shown - boolean
debug: true