mirror of
https://oauth2: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@github.com/m1ngsama/TNT.git
synced 2026-06-26 05:44:38 +08:00
147 lines
3.9 KiB
YAML
147 lines
3.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-24.04
|
|
target: linux-amd64
|
|
artifact: tnt-linux-amd64
|
|
- os: ubuntu-24.04-arm
|
|
target: linux-arm64
|
|
artifact: tnt-linux-arm64
|
|
- os: macos-15-intel
|
|
target: darwin-amd64
|
|
artifact: tnt-darwin-amd64
|
|
- os: macos-15
|
|
target: darwin-arm64
|
|
artifact: tnt-darwin-arm64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies (Ubuntu)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libssh-dev
|
|
|
|
- name: Install dependencies (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
brew install libssh
|
|
|
|
- name: Run release preflight
|
|
run: make release-check
|
|
|
|
- name: Build release binary
|
|
run: make release
|
|
|
|
- name: Verify artifact architecture
|
|
run: |
|
|
file tnt
|
|
case "${{ matrix.target }}" in
|
|
linux-amd64)
|
|
file tnt | grep -E 'ELF 64-bit.*x86-64'
|
|
;;
|
|
linux-arm64)
|
|
file tnt | grep -E 'ELF 64-bit.*(aarch64|ARM aarch64)'
|
|
;;
|
|
darwin-amd64)
|
|
file tnt | grep -E 'Mach-O 64-bit.*x86_64'
|
|
;;
|
|
darwin-arm64)
|
|
file tnt | grep -E 'Mach-O 64-bit.*arm64'
|
|
;;
|
|
esac
|
|
|
|
- name: Rename binary
|
|
run: mv tnt ${{ matrix.artifact }}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact }}
|
|
path: ${{ matrix.artifact }}
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: ./artifacts
|
|
|
|
- name: Create checksums
|
|
run: |
|
|
cd artifacts
|
|
: > checksums.txt
|
|
for artifact in */tnt-*; do
|
|
sha256sum "$artifact" | sed "s# $artifact# $(basename "$artifact")#" >> checksums.txt
|
|
done
|
|
cat checksums.txt
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
files: |
|
|
artifacts/*/tnt-*
|
|
artifacts/checksums.txt
|
|
body: |
|
|
## Installation
|
|
|
|
Download the binary for your platform:
|
|
|
|
**Linux AMD64:**
|
|
```bash
|
|
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/tnt-linux-amd64
|
|
chmod +x tnt-linux-amd64
|
|
sudo mv tnt-linux-amd64 /usr/local/bin/tnt
|
|
```
|
|
|
|
**Linux ARM64:**
|
|
```bash
|
|
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/tnt-linux-arm64
|
|
chmod +x tnt-linux-arm64
|
|
sudo mv tnt-linux-arm64 /usr/local/bin/tnt
|
|
```
|
|
|
|
**macOS Intel:**
|
|
```bash
|
|
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/tnt-darwin-amd64
|
|
chmod +x tnt-darwin-amd64
|
|
sudo mv tnt-darwin-amd64 /usr/local/bin/tnt
|
|
```
|
|
|
|
**macOS Apple Silicon:**
|
|
```bash
|
|
wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/tnt-darwin-arm64
|
|
chmod +x tnt-darwin-arm64
|
|
sudo mv tnt-darwin-arm64 /usr/local/bin/tnt
|
|
```
|
|
|
|
**Verify checksums:**
|
|
```bash
|
|
sha256sum -c checksums.txt
|
|
```
|
|
|
|
## What's Changed
|
|
See [docs/CHANGELOG.md](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/docs/CHANGELOG.md)
|
|
draft: true
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|