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
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

on:
push:
tags:
- 'v*'

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# - os: macos-latest
# target: x86_64-apple-darwin
# - os: windows-latest
# target: x86_64-pc-windows-msvc

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
with:
targets: ${{ matrix.target }}

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.target }}-release-${{ hashFiles('**/Cargo.lock') }}

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

# Smoosh binaries into a .tar.gz per platform
- name: Package
shell: bash
run: |
mkdir dist
cp target/${{ matrix.target }}/release/placy dist/ 2>/dev/null || true
cp target/${{ matrix.target }}/release/placy.exe dist/ 2>/dev/null || true
cp target/${{ matrix.target }}/release/placy-server dist/ 2>/dev/null || true
cp target/${{ matrix.target }}/release/placy-server.exe dist/ 2>/dev/null || true
tar -czf placy-${{ github.ref_name }}-${{ matrix.target }}.tar.gz -C dist .

- uses: actions/upload-artifact@v4
with:
name: placy-${{ matrix.target }}
path: placy-${{ github.ref_name }}-${{ matrix.target }}.tar.gz

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write # needed to create the release

steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
generate_release_notes: true # auto-generates changelog from PRs/commits
files: artifacts/*
Loading