Skip to content

0.1.2

0.1.2 #6

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- target: linux-x64
runner: ubuntu-latest
artifact: spm-linux-x64
- target: darwin-arm64
runner: macos-latest
artifact: spm-darwin-arm64
- target: darwin-x64
runner: macos-latest
artifact: spm-darwin-x64
- target: windows-x64
runner: windows-latest
artifact: spm-windows-x64.exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build binary
shell: bash
run: |
case "${{ matrix.target }}" in
linux-x64)
bun build index.ts --compile --target=bun-linux-x64 --outfile dist/spm-linux-x64
;;
darwin-arm64)
bun build index.ts --compile --target=bun-darwin-arm64 --outfile dist/spm-darwin-arm64
;;
darwin-x64)
bun build index.ts --compile --target=bun-darwin-x64 --outfile dist/spm-darwin-x64
;;
windows-x64)
bun build index.ts --compile --target=bun-windows-x64 --outfile dist/spm-windows-x64.exe
;;
esac
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: spm-${{ matrix.target }}
path: dist/${{ matrix.artifact }}
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release
for dir in artifacts/spm-*/; do
cp "$dir"/* release/ 2>/dev/null || true
done
ls -la release/
- name: Determine version
id: version
run: |
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: ${{ steps.version.outputs.tag }}
generate_release_notes: true
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}