mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-03-25 21:40:52 +00:00
Mise à jour du workflow de release pour utiliser ubuntu-24.04-arm au lieu de ubuntu-latest pour ARM64, et macos-15-intel au lieu de macos-latest pour macOS. Suppression de la compilation croisée pour ARM64 et ajustement de l'installation des outils de build pour macOS.
175 lines
5.3 KiB
YAML
175 lines
5.3 KiB
YAML
name: Create Release on Tag
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "Release_*"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
# First run tests
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.23"
|
|
- name: Checkout obitools4 project
|
|
uses: actions/checkout@v4
|
|
- name: Run tests
|
|
run: make githubtests
|
|
|
|
# Build binaries for each platform
|
|
build:
|
|
needs: test
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
goos: linux
|
|
goarch: amd64
|
|
output_name: linux_amd64
|
|
- os: ubuntu-24.04-arm
|
|
goos: linux
|
|
goarch: arm64
|
|
output_name: linux_arm64
|
|
- os: macos-15-intel
|
|
goos: darwin
|
|
goarch: amd64
|
|
output_name: darwin_amd64
|
|
- os: macos-latest
|
|
goos: darwin
|
|
goarch: arm64
|
|
output_name: darwin_arm64
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.23"
|
|
|
|
- name: Extract version from tag
|
|
id: get_version
|
|
run: |
|
|
TAG=${GITHUB_REF#refs/tags/Release_}
|
|
echo "version=$TAG" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install build tools (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
# Ensure Xcode Command Line Tools are installed
|
|
xcode-select --install 2>/dev/null || true
|
|
xcode-select -p
|
|
|
|
- name: Build binaries
|
|
env:
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
VERSION: ${{ steps.get_version.outputs.version }}
|
|
run: |
|
|
make obitools
|
|
mkdir -p artifacts
|
|
cd build
|
|
for binary in *; do
|
|
tar -czf ../artifacts/${binary}_${VERSION}_${{ matrix.output_name }}.tar.gz ${binary}
|
|
done
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: binaries-${{ matrix.output_name }}
|
|
path: artifacts/*
|
|
|
|
# Create the release
|
|
create-release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Extract version from tag
|
|
id: get_version
|
|
run: |
|
|
TAG=${GITHUB_REF#refs/tags/Release_}
|
|
echo "version=$TAG" >> $GITHUB_OUTPUT
|
|
|
|
- name: Download all artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: release-artifacts
|
|
|
|
- name: Prepare release directory
|
|
run: |
|
|
mkdir -p release
|
|
find release-artifacts -type f -name "*.tar.gz" -exec cp {} release/ \;
|
|
ls -lh release/
|
|
|
|
- name: Generate Release Notes
|
|
env:
|
|
VERSION: ${{ steps.get_version.outputs.version }}
|
|
run: |
|
|
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
|
|
|
echo "# OBITools4 Release ${VERSION}" > release_notes.md
|
|
echo "" >> release_notes.md
|
|
|
|
if [ -n "$PREV_TAG" ]; then
|
|
echo "## Changes since ${PREV_TAG}" >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
git log ${PREV_TAG}..HEAD --pretty=format:"- %s" >> release_notes.md
|
|
else
|
|
echo "## Changes" >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
git log --pretty=format:"- %s" -n 20 >> release_notes.md
|
|
fi
|
|
|
|
echo "" >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "## Installation" >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "Download the appropriate binary for your system and extract it:" >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "### Linux (AMD64)" >> release_notes.md
|
|
echo '```bash' >> release_notes.md
|
|
echo "tar -xzf <tool>_${VERSION}_linux_amd64.tar.gz" >> release_notes.md
|
|
echo '```' >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "### Linux (ARM64)" >> release_notes.md
|
|
echo '```bash' >> release_notes.md
|
|
echo "tar -xzf <tool>_${VERSION}_linux_arm64.tar.gz" >> release_notes.md
|
|
echo '```' >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "### macOS (Intel)" >> release_notes.md
|
|
echo '```bash' >> release_notes.md
|
|
echo "tar -xzf <tool>_${VERSION}_darwin_amd64.tar.gz" >> release_notes.md
|
|
echo '```' >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "### macOS (Apple Silicon)" >> release_notes.md
|
|
echo '```bash' >> release_notes.md
|
|
echo "tar -xzf <tool>_${VERSION}_darwin_arm64.tar.gz" >> release_notes.md
|
|
echo '```' >> release_notes.md
|
|
echo "" >> release_notes.md
|
|
echo "Available tools: Replace \`<tool>\` with one of the obitools commands." >> release_notes.md
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
name: Release ${{ steps.get_version.outputs.version }}
|
|
body_path: release_notes.md
|
|
files: release/*
|
|
draft: false
|
|
prerelease: false
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|