Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 14 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,30 @@ permissions:


jobs:
build-release:

name: Build Release (${{ matrix.name }})
build:

strategy:
fail-fast: false

matrix:
include:

- name: Linux
- name: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary: hive
output: hive-linux


- name: Windows
- name: windows
os: windows-latest
target: x86_64-pc-windows-gnu
binary: hive.exe
output: hive-windows.exe


runs-on: ${{ matrix.os }}


steps:

- name: Checkout repository
- name: Checkout
uses: actions/checkout@v4


Expand All @@ -50,42 +44,21 @@ jobs:
targets: ${{ matrix.target }}


- name: Cache Cargo
uses: Swatinem/rust-cache@v2


- name: Build release binary
- name: Build
run: cargo build --release --target ${{ matrix.target }}


- name: Prepare Linux binary
if: matrix.name == 'Linux'
shell: bash
run: |
mkdir dist
cp target/${{ matrix.target }}/release/${{ matrix.binary }} dist/${{ matrix.output }}


- name: Prepare Windows binary
if: matrix.name == 'Windows'
shell: bash
run: |
mkdir dist
cp target/${{ matrix.target }}/release/${{ matrix.binary }} dist/${{ matrix.output }}


- name: Upload release artifact
- name: Upload
uses: actions/upload-artifact@v4
with:
name: hive-${{ matrix.name }}
path: dist/
path: target/${{ matrix.target }}/release/${{ matrix.binary }}


create-release:

name: Create GitHub Release
release:

needs: build-release
needs: build

runs-on: ubuntu-latest

Expand All @@ -95,14 +68,14 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release-files
path: artifacts


- name: Create Release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Hive CLI ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
generate_release_notes: true
files: |
release-files/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
artifacts/**/*
Loading