Skip to content

Commit

Permalink
try: release
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrita committed Apr 12, 2024
1 parent 5d8ea3d commit 8e1e00f
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 419 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Rust Build and Release

on:
push:
paths:
- '**/*.rs'
- 'Cargo.toml'
workflow_dispatch:

jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build & Rename
shell: bash
run: |
cargo build --profile opt --target ${{ matrix.target }}
mkdir -p build
cp $(find target -maxdepth 2 -type f -executable | head -n 1) build/peerban-${{ matrix.target }}${{ matrix.os == 'windows-latest' && '.exe' || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: build/*

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: release_binaries

- name: Get version
run: |
echo "VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)" > $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: release_binaries/**
tag_name: ${{ env.VERSION }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 8e1e00f

Please sign in to comment.